forked from tilt-dev/tilt-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile
25 lines (25 loc) · 768 Bytes
/
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
def build_flake_image(ref, path = "", output = "", resultfile = "result", deps = []):
build_cmd = "nix build {path}#{output} --refresh --out-link result-{ref}".format(
path = path,
output = output,
ref = ref
)
commands = [
build_cmd,
"docker image load -i ./result-{ref}".format(ref = ref),
'IMG_NAME="$(tar -Oxf "./result-{ref}" 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,
)