-
Notifications
You must be signed in to change notification settings - Fork 17
/
Tiltfile
39 lines (31 loc) · 1.06 KB
/
Tiltfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Custom build tool for nix flakes
def build_flake_image(ref, path = "", output = "", resultfile = "result", deps = []):
build_cmd = "nix build {path}#{output} --refresh --no-link --print-out-paths".format(
path = path,
output = output
)
commands = [
"RESULT_IMAGE=$({cmd})".format(cmd = build_cmd),
"docker image load -i ${RESULT_IMAGE}",
'IMG_NAME="$(tar -Oxf $RESULT_IMAGE manifest.json | jq -r ".[0].RepoTags[0]")"'.format(ref = ref),
"docker tag ${IMG_NAME} ${EXPECTED_REF}"
]
custom_build(
ref,
command = [
"nix-shell",
"--packages",
"coreutils",
"gnutar",
"jq",
"--run",
";\n".join(commands),
],
deps = deps,
)
image_name = "kurtosistech/kardinal-manager"
build_flake_image(image_name , ".", "kardinal-manager-container", deps=["./kardinal-manager"])
yaml_dir = "./kardinal-manager/deployment"
k8s_yaml(yaml=(yaml_dir + "/k8s.yaml"))
if k8s_context:
k8s_context(k8s_context)