-
Notifications
You must be signed in to change notification settings - Fork 153
/
Tiltfile
69 lines (55 loc) · 1.82 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Anyone seen Fast and Furious? :)
# Allow a K8s context named wego-dev, in addition to the local cluster
allow_k8s_contexts('wego-dev')
if os.getenv('MANUAL_MODE'):
trigger_mode(TRIGGER_MODE_MANUAL)
# Support IMAGE_REPO env so that we can run Tilt with a remote cluster
image_repository = os.getenv('IMAGE_REPO', 'localhost:5001/weaveworks/wego-app')
load('ext://restart_process', 'docker_build_with_restart')
advanced_go_dev_mode = os.getenv('FAST_AND_FURIOUSER')
skip_ui_build = os.getenv("SKIP_UI_BUILD")
if advanced_go_dev_mode:
local_resource(
'gitops-server',
'GOOS=linux make gitops-server',
deps=[
'./cmd',
'./pkg',
'./core',
'./api',
]
)
if not skip_ui_build:
local_resource(
'ui-server',
'make ui',
deps=[
'./ui',
]
)
docker_build_with_restart(
image_repository,
'.',
only=[
'./bin',
],
dockerfile="dev.dockerfile",
entrypoint="/app/build/gitops-server --log-level=debug --insecure",
live_update=[
sync('./bin', '/app/build'),
],
)
else:
docker_build(
image_repository,
'.',
dockerfile="gitops-server.dockerfile",
)
# Override image.repository of the dev Helm chart with image_repository
k8s_yaml(helm('./charts/gitops-server', name='dev', values='./tools/helm-values-dev.yaml', set=['image.repository=' + image_repository]))
k8s_yaml(helm('./tools/charts/dev', name='dev', values='./tools/charts/dev/values.yaml'))
deps = ['gitops-server'] if advanced_go_dev_mode else []
if advanced_go_dev_mode:
if not skip_ui_build:
deps.append('ui-server')
k8s_resource('dev-weave-gitops', port_forwards='9001', resource_deps=deps)