2023-11-19 01:11:49 +00:00
|
|
|
{
|
2023-11-19 22:05:42 +00:00
|
|
|
builders,
|
2023-11-19 01:11:49 +00:00
|
|
|
charts,
|
2023-11-19 03:01:30 +00:00
|
|
|
pkgs,
|
2023-11-19 06:38:06 +00:00
|
|
|
}: let
|
|
|
|
in rec {
|
2023-11-19 19:46:27 +00:00
|
|
|
imageAttrs = string:
|
2023-11-19 06:38:06 +00:00
|
|
|
with builtins; let
|
|
|
|
vals = split ":" string;
|
|
|
|
in {
|
|
|
|
repository = elemAt vals 0;
|
|
|
|
tag = elemAt vals 2;
|
|
|
|
};
|
|
|
|
|
|
|
|
mkExistingClaim = pvc: subPath: {
|
|
|
|
existingClaim = pvc;
|
|
|
|
inherit subPath;
|
|
|
|
};
|
2023-11-19 01:11:49 +00:00
|
|
|
|
2023-11-19 06:38:06 +00:00
|
|
|
build = {
|
2023-11-19 01:11:49 +00:00
|
|
|
namespace,
|
|
|
|
name,
|
|
|
|
mainImage,
|
2023-11-19 19:35:35 +00:00
|
|
|
values ? {},
|
2023-11-21 03:30:55 +00:00
|
|
|
apiVersions ? [],
|
2023-11-19 19:35:35 +00:00
|
|
|
}:
|
2023-11-19 22:05:42 +00:00
|
|
|
builders.helmChart {
|
2023-11-21 03:30:55 +00:00
|
|
|
inherit name namespace apiVersions;
|
2023-11-19 01:11:49 +00:00
|
|
|
chart = charts.bjw-s.app-template;
|
|
|
|
values =
|
2023-11-19 03:01:30 +00:00
|
|
|
pkgs.lib.attrsets.recursiveUpdate
|
2023-11-19 19:35:35 +00:00
|
|
|
{
|
|
|
|
controllers.main.containers.main.image =
|
2023-11-19 19:46:27 +00:00
|
|
|
imageAttrs mainImage;
|
2023-11-19 19:35:35 +00:00
|
|
|
}
|
2023-11-19 19:46:27 +00:00
|
|
|
values;
|
2023-11-19 01:11:49 +00:00
|
|
|
};
|
2023-11-18 10:08:23 +00:00
|
|
|
}
|