-
Notifications
You must be signed in to change notification settings - Fork 10
/
Tiltfile
78 lines (60 loc) · 2.51 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
70
71
72
73
74
75
76
77
78
# -*- mode: Python -*-
load('ext://uibutton', 'cmd_button')
load('ext://namespace', 'namespace_create')
cmd_button(name='disable all',
argv=['tilt', 'disable', '--all'],
text='disable all',
location='nav',
icon_name='swipe_down',
)
cmd_button(name='enable all',
argv=['tilt', 'enable', '--all'],
text='enable all',
location='nav',
icon_name='swipe_up',
)
namespace_create('datree')
DATREE_TOKEN=os.environ.get('DATREE_TOKEN')
k8s_yaml(helm('./charts/datree-admission-webhook/', name='admission-webhook', values='internal/fixtures/values.dev.yaml', namespace='datree', set=['devMode.enabled=true ','securityContext.runAsUser=1000', 'securityContext.readOnlyRootFilesystem=false', 'clusterScanner.image.pullPolicy=Never', "datree.token={}".format(DATREE_TOKEN)]))
def debugging():
docker_build('webhook-server', './', dockerfile = './Dockerfile.debugging.tilt', build_args={
"BUILD_ENVIRONMENT":"staging",
"WEBHOOK_VERSION":"0.0.1",
})
docker_build('datree/cluster-scanner-staging', '../cluster-scanner', dockerfile = '../cluster-scanner/Dockerfile.debugging.tilt', build_args={
"BUILD_ENVIRONMENT":"staging",
"SCANNER_VERSION":"0.0.1",
})
local_resource(
name='datree-webhook-server-debuging',
serve_cmd='bash ./tilt/scripts/port-forwarding-for-debugging.sh "datree-webhook-server" "5555"',
)
local_resource(
name='cluster-scanner debugging',
serve_cmd='bash ./tilt/scripts/port-forwarding-for-debugging.sh "datree-cluster-scanner-server" "5556"',
)
local_resource(
name='webhook - restart port-forwarding',
serve_cmd='bash ./tilt/scripts/restart-port-forwarding.sh "datree-webhook-server" "datree-webhook-server-debuging"',
)
local_resource(
name='cluster-scanner - restart port-forwarding',
serve_cmd='bash ./tilt/scripts/restart-port-forwarding.sh "datree-cluster-scanner-server" "cluster-scanner debugging"',
)
def hot_reload():
docker_build('webhook-server', './', dockerfile = './Dockerfile',
build_args={
"BUILD_ENVIRONMENT":"staging",
"WEBHOOK_VERSION":"0.0.1",
}
)
docker_build('datree/cluster-scanner-staging', '../cluster-scanner', dockerfile = '../cluster-scanner/Dockerfile',
build_args={
"BUILD_ENVIRONMENT":"staging",
"SCANNER_VERSION":"0.0.1",
}
)
if os.environ.get('TILT_ENV') == 'debugging':
debugging()
else:
hot_reload()