-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tiltfile
87 lines (79 loc) · 1.7 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
79
80
81
82
83
84
85
86
87
load('ext://restart_process', 'docker_build_with_restart')
# example-server
local_resource(
'example-server-compile',
'cd example && CGO_ENABLED=0 GOOS=linux go build -o ../.tilt/server ./cmd/server/main.go',
deps=[
'./example/cmd/server',
'./example/internal/examplepb'
]
)
docker_build_with_restart(
'example-server',
dockerfile='hack/tilt/Dockerfile.example-server',
context='.',
entrypoint="/server/server",
only=[
'./.tilt/server',
],
live_update=[
sync('./.tilt/server', '/server/server'),
]
)
# example-app
local_resource(
'example-app-compile',
'cd example && CGO_ENABLED=0 GOOS=linux go build -o ../.tilt/app ./cmd/app/main.go',
deps=[
'./go.mod',
'./go.sum',
'./balancer.go',
'./dispatcher.go',
'./options.go',
'./resolver.go',
'./example/cmd/app',
'./example/internal/app',
'./example/internal/examplepb'
]
)
docker_build_with_restart(
'example-app',
dockerfile='hack/tilt/Dockerfile.example-app',
context='.',
entrypoint="/app/app",
only=[
'./.tilt/app',
'./example/templates'
],
live_update=[
sync('./.tilt/app', '/app/app'),
]
)
# apply manifests
k8s_yaml('hack/tilt/example-server.yaml')
k8s_yaml('hack/tilt/example-app.yaml')
k8s_yaml('hack/tilt/chaoskube.yaml')
# define resources
k8s_resource(
'example-server',
port_forwards='50051:50051'
)
k8s_resource(
'example-app',
objects=[
'example-app:serviceaccount',
'example-app:role',
'example-app:rolebinding'
],
port_forwards='4000:4000'
)
k8s_resource(
'chaoskube',
objects=[
'chaoskube:serviceaccount',
'chaoskube:clusterrole',
'chaoskube:clusterrolebinding',
'chaoskube:role',
'chaoskube:rolebinding'
]
)