-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudbuild_release.yaml
227 lines (224 loc) · 9.2 KB
/
cloudbuild_release.yaml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
steps:
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
id: get-github-keys
args: ['-c', 'echo $$SSH_KEY > /workspace/id_rsa']
secretEnv: ['SSH_KEY']
- name: 'gcr.io/cloud-builders/docker'
id: build-docker-general
entrypoint: 'bash'
args: ['-c', 'docker build -f ./containers/general/Dockerfile -t refractionpoint/lc-adapter:$TAG_NAME -t gcr.io/$PROJECT_ID/github.com/refractionpoint/usp-adapters/lc-adapter:$TAG_NAME -t refractionpoint/lc-adapter:latest .']
waitFor: ['get-github-keys']
- name: 'gcr.io/cloud-builders/docker'
id: build-docker-zeek
entrypoint: 'bash'
args: ['-c', 'cd ./containers/zeek/ && docker build -f ./Dockerfile -t refractionpoint/lc-adapter-zeek:$TAG_NAME -t refractionpoint/lc-adapter-zeek:latest .']
waitFor: ['get-github-keys']
- name: 'gcr.io/cloud-builders/docker'
id: build-docker-zeek-extract
entrypoint: 'bash'
args: ['-c', 'cd ./containers/zeek_extract/ && docker build -f ./Dockerfile -t refractionpoint/lc-adapter-zeek-extract:$TAG_NAME -t refractionpoint/lc-adapter-zeek-extract:latest .']
waitFor: ['get-github-keys']
- name: 'gcr.io/cloud-builders/docker'
id: build-docker-k8s-pods
entrypoint: 'bash'
args: ['-c', 'cd ./containers/k8s_pods/ && docker build -f ./Dockerfile -t refractionpoint/lc-adapter-k8s-pods:$TAG_NAME -t refractionpoint/lc-adapter-k8s-pods:latest .']
waitFor: ['get-github-keys']
# Adapters
- name: 'golang:1.22-bullseye'
id: build-linux64
args: ['go', 'build', '-v', '-o', 'lc_adapter_linux_64_$TAG_NAME', './containers/general']
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-win64
args: ['go', 'build', '-v', '-o', 'lc_adapter_windows_64_$TAG_NAME.exe', './containers/general']
env:
- 'GOOS=windows'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-macos64
args: ['go', 'build', '-v', '-o', 'lc_adapter_macos_64_$TAG_NAME', './containers/general']
env:
- 'GOOS=darwin'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-macosarm64
args: ['go', 'build', '-v', '-o', 'lc_adapter_macos_arm64_$TAG_NAME', './containers/general']
env:
- 'GOOS=darwin'
- 'GOARCH=arm64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-linuxarm
args: ['go', 'build', '-v', '-o', 'lc_adapter_linux_arm_$TAG_NAME', './containers/general']
env:
- 'GOOS=linux'
- 'GOARCH=arm'
- 'GOARM=5'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-linuxarm64
args: ['go', 'build', '-v', '-o', 'lc_adapter_linux_arm64_$TAG_NAME', './containers/general']
env:
- 'GOOS=linux'
- 'GOARCH=arm64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-solarisamd64
args: ['go', 'build', '-v', '-o', 'lc_adapter_solaris_amd64_$TAG_NAME', './containers/general']
env:
- 'GOOS=solaris'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-aixppc64
args: ['go', 'build', '-v', '-o', 'lc_adapter_aix_ppc64_$TAG_NAME', './containers/general']
env:
- 'GOOS=aix'
- 'GOARCH=ppc64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: 'build-freebsdamd64'
args: ['go', 'build', '-v', '-o', 'lc_adapter_freebsd_64_$TAG_NAME', './containers/general']
env:
- 'GOOS=freebsd'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: 'build-netbsdamd64'
args: ['go', 'build', '-v', '-o', 'lc_adapter_netbsd_64_$TAG_NAME', './containers/general']
env:
- 'GOOS=netbsd'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: 'build-openbsdamd64'
args: ['go', 'build', '-v', '-o', 'lc_adapter_openbsd_64_$TAG_NAME', './containers/general']
env:
- 'GOOS=openbsd'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
# Connectivity Tester
- name: 'golang:1.22-bullseye'
id: build-linux64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_linux_64_$TAG_NAME', './containers/connectivity']
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-win64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_windows_64_$TAG_NAME.exe', './containers/connectivity']
env:
- 'GOOS=windows'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-macos64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_macos_64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=darwin'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-macosarm64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_macos_arm64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=darwin'
- 'GOARCH=arm64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-linuxarm-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_linux_arm_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=linux'
- 'GOARCH=arm'
- 'GOARM=5'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-linuxarm64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_linux_arm64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=linux'
- 'GOARCH=arm64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-solarisamd64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_solaris_amd64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=solaris'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-aixppc64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_aix_ppc64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=aix'
- 'GOARCH=ppc64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-freebsdamd64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_freebsd_64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=freebsd'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-netbsdamd64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_netbsd_64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=netbsd'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
- name: 'golang:1.22-bullseye'
id: build-openbsdamd64-connectivity
args: ['go', 'build', '-v', '-o', 'lc_connectivity_openbsd_64_$TAG_NAME', './containers/connectivity']
env:
- 'GOOS=openbsd'
- 'GOARCH=amd64'
waitFor: ['get-github-keys']
# Stage binaries
- name: 'gcr.io/cloud-builders/gsutil'
id: copy-binary-adapters
args: ['cp', './lc_adapter_*', 'gs://limacharlie-io/installers/']
waitFor: ['build-linux64', 'build-win64', 'build-macos64', 'build-macosarm64', 'build-linuxarm', 'build-linuxarm64', 'build-solarisamd64', 'build-aixppc64', 'build-freebsdamd64', 'build-netbsdamd64', 'build-openbsdamd64']
- name: 'gcr.io/cloud-builders/gsutil'
id: copy-binary-connectivity
args: ['cp', './lc_connectivity_*', 'gs://limacharlie-io/installers/']
waitFor: ['build-linux64-connectivity', 'build-win64-connectivity', 'build-macos64-connectivity', 'build-macosarm64-connectivity', 'build-linuxarm-connectivity', 'build-linuxarm64-connectivity', 'build-solarisamd64-connectivity', 'build-aixppc64-connectivity', 'build-freebsdamd64-connectivity', 'build-netbsdamd64-connectivity', 'build-openbsdamd64-connectivity']
- name: 'gcr.io/cloud-builders/docker'
id: copy-docker-adapter-general
entrypoint: 'bash'
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD && docker push refractionpoint/lc-adapter:$TAG_NAME && docker push refractionpoint/lc-adapter:latest']
secretEnv: ['USERNAME', 'PASSWORD']
waitFor: ['build-docker-general']
- name: 'gcr.io/cloud-builders/docker'
id: copy-docker-adapter-zeek
entrypoint: 'bash'
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD && docker push refractionpoint/lc-adapter-zeek:$TAG_NAME && docker push refractionpoint/lc-adapter-zeek:latest']
secretEnv: ['USERNAME', 'PASSWORD']
waitFor: ['build-docker-zeek']
- name: 'gcr.io/cloud-builders/docker'
id: copy-docker-adapter-zeek-extract
entrypoint: 'bash'
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD && docker push refractionpoint/lc-adapter-zeek-extract:$TAG_NAME && docker push refractionpoint/lc-adapter-zeek-extract:latest']
secretEnv: ['USERNAME', 'PASSWORD']
waitFor: ['build-docker-zeek-extract']
- name: 'gcr.io/cloud-builders/docker'
id: copy-docker-adapter-k8s-pods
entrypoint: 'bash'
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD && docker push refractionpoint/lc-adapter-k8s-pods:$TAG_NAME && docker push refractionpoint/lc-adapter-k8s-pods:latest']
secretEnv: ['USERNAME', 'PASSWORD']
waitFor: ['build-docker-k8s-pods']
images:
- gcr.io/$PROJECT_ID/github.com/refractionpoint/usp-adapters/lc-adapter:$TAG_NAME
availableSecrets:
secretManager:
- versionName: projects/${PROJECT_ID}/secrets/DOCKERHUB/versions/latest
env: 'PASSWORD'
- versionName: projects/${PROJECT_ID}/secrets/DOCKERHUB_USERNAME/versions/latest
env: 'USERNAME'
- versionName: projects/${PROJECT_ID}/secrets/GITHUB-DEPS-ACCESS/versions/latest
env: 'SSH_KEY'
options:
machineType: 'N1_HIGHCPU_32'
timeout: 30m