forked from tilt-dev/tilt-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile
28 lines (24 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
# -*- mode: Python -*-
def kim_build(ref, context, ignore=None, extra_flags=None, **kwargs):
"""Use kim (https://github.com/rancher/kim) to build images for Tilt.
Args:
ref: The name of the image to build. Must match the image
name in the Kubernetes resources you're deploying.
context: The build context of the image to build. Expressed as a file path.
ignore: Changes to the given files or directories do not trigger rebuilds.
Does not affect the build context.
extra_flags: Extra flags to pass to kim build. Expressed as an argv-style array.
**kwargs: will be passed to the underlying `custom_build` call
"""
extra_flags = extra_flags or []
extra_flags_str = ' '.join([shlex.quote(f) for f in extra_flags])
custom_build(
ref=ref,
command="kim build -t $EXPECTED_REF %s %s\n" % (extra_flags_str, shlex.quote(context)),
command_bat="kim build -t %%EXPECTED_REF%% %s %s\n" % (extra_flags_str, shlex.quote(context)),
ignore=ignore,
deps=[context],
skips_local_docker=True,
disable_push=True,
**kwargs
)