-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile
160 lines (149 loc) · 3.1 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
version_settings(constraint='>=0.22.2')
load('ext://configmap', 'configmap_create')
# Generate the controller image.
docker_build(
'diy-sm-controller',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/controller/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'controller',
},
)
# Generate the proxy image.
docker_build(
'diy-sm-proxy',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/proxy/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'proxy',
},
match_in_env_vars=True, # To inject into the injector env vars
)
# Generate the proxy-init image.
docker_build(
'diy-sm-proxy-init',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/proxy-init/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'proxy-init',
'SET_CAP': 'true',
},
match_in_env_vars=True, # To inject into the injector env vars
)
# Generate the proxy injector image.
docker_build(
'diy-sm-injector',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/injector/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'injector',
},
)
# Generate the http-client image.
docker_build(
'diy-sm-http-client',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/http-client/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'http-client',
},
)
# Generate the http-server image.
docker_build(
'diy-sm-http-server',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/http-server/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'http-server',
},
)
# Generate the grpc-client image.
docker_build(
'diy-sm-grpc-client',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/grpc-client/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'grpc-client',
},
)
# Generate the grpc-client image.
docker_build(
'diy-sm-grpc-server',
context='.',
dockerfile='./Dockerfile',
only=[
'./go.mod',
'./go.sum',
'./cmd/grpc-server/',
'./protogen/',
'./vendor/',
],
build_args={
'APP_NAME': 'grpc-server',
},
)
# Generate the proto files
local_resource(
'protobuild',
cmd='PATH="$PATH:$(pwd)/bin" buf generate',
deps=[
'proto',
'buf.gen.yaml'
],
)
# Apply resources to the cluster
k8s_yaml('k8s/controller.yaml')
k8s_yaml('k8s/injector.yaml', allow_duplicates=True)
k8s_yaml('k8s/http-client.yaml')
k8s_yaml('k8s/http-server.yaml')
k8s_yaml('k8s/grpc-client.yaml')
k8s_yaml('k8s/grpc-server.yaml')