-
Notifications
You must be signed in to change notification settings - Fork 20
/
.goreleaser.yaml
354 lines (330 loc) · 12.4 KB
/
.goreleaser.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# SPDX-FileCopyrightText: 2024 Buoyant Inc.
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2022-2024 Buoyant Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Docs for goreleaser are at https://goreleaser.com.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
# Allow overriding the registry and image name with environment variables.
env:
- REGISTRY={{ if index .Env "REGISTRY" }}{{ .Env.REGISTRY }}{{ else }}ghcr.io/buoyantio{{ end }}
- IMAGE_NAME={{ if index .Env "IMAGE_NAME" }}{{ .Env.IMAGE_NAME }}{{ else }}faces{{ end }}
- EXTERNAL_BASE={{ if index .Env "EXTERNAL_BASE" }}{{ .Env.EXTERNAL_BASE }}{{ else }}ghcr.io/buoyantio/demo-external-base:0.3.0{{ end }}
- BEL_EXTERNAL_BASE={{ if index .Env "BEL_EXTERNAL_BASE" }}{{ .Env.BEL_EXTERNAL_BASE }}{{ else }}ghcr.io/buoyantio/demo-bel-external-base:0.3.0{{ end }}
before:
hooks:
- go mod tidy
# Make the chart as part of the build process.
- make VERSION={{ .Version }} chart
builds:
# "generic-" builds are for any random hardware out there.
- id: generic-workload
main: ./cmd/generic/workload
binary: workload
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- arm64
- amd64
- id: generic-color
main: ./cmd/generic/color
binary: color-workload
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- arm64
- amd64
# "pi" is our build specifically for the Raspberry Pi (it uses Pi GPIO for
# some LEDs and a knob).
- id: pi
main: ./cmd/raspberry-pi
binary: workload
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- arm64
# We build GUI and workload images for both arm64 and amd64, then build a
# multiarch manifest from them.
dockers:
### GUI images
- use: buildx
goos: linux
goarch: arm64
dockerfile: Dockerfiles/Dockerfile.gui
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:latest-arm64"
build_flag_templates:
- "--platform=linux/arm64"
extra_files:
- assets/html
- use: buildx
goos: linux
goarch: amd64
dockerfile: Dockerfiles/Dockerfile.gui
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:{{ .Version }}-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
extra_files:
- assets/html
### Generic workload images: this is the multifunction image that can be any HTTP workload.
- use: buildx
goos: linux
goarch: arm64
dockerfile: Dockerfiles/Dockerfile.workload
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:latest-arm64"
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=WORKLOAD=workload"
- use: buildx
goos: linux
goarch: amd64
dockerfile: Dockerfiles/Dockerfile.workload
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:{{ .Version }}-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=WORKLOAD=workload"
### Color workload images: this can only be a gRPC color workload.
- use: buildx
goos: linux
goarch: arm64
dockerfile: Dockerfiles/Dockerfile.workload
ids:
- generic-color
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:latest-arm64"
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=WORKLOAD=color-workload"
- use: buildx
goos: linux
goarch: amd64
dockerfile: Dockerfiles/Dockerfile.workload
ids:
- generic-color
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:{{ .Version }}-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=WORKLOAD=color-workload"
- use: buildx
goos: linux
goarch: arm64
dockerfile: Dockerfiles/Dockerfile.external-workload
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:latest-arm64"
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=EXTERNAL_BASE={{ .Env.EXTERNAL_BASE }}"
- "--build-arg=WORKLOAD=workload"
- use: buildx
goos: linux
goarch: amd64
dockerfile: Dockerfiles/Dockerfile.external-workload
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:{{ .Version }}-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=EXTERNAL_BASE={{ .Env.EXTERNAL_BASE }}"
- "--build-arg=WORKLOAD=workload"
- use: buildx
goos: linux
goarch: arm64
dockerfile: Dockerfiles/Dockerfile.bel-external-workload
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:latest-arm64"
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=EXTERNAL_BASE={{ .Env.BEL_EXTERNAL_BASE }}"
- "--build-arg=WORKLOAD=workload"
- use: buildx
goos: linux
goarch: amd64
dockerfile: Dockerfiles/Dockerfile.bel-external-workload
ids:
- generic-workload
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:{{ .Version }}-amd64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:latest-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=EXTERNAL_BASE={{ .Env.BEL_EXTERNAL_BASE }}"
- "--build-arg=WORKLOAD=workload"
# For the Pi, we only build an external-workload image for arm64. The Pi itself
# is arm64, so there's no point in building for amd64, and we're not going to try
# to access Pi GPIO from inside Kubernetes.
- use: buildx
goos: linux
goarch: arm64
# Not a typo! We really do use the same Dockerfile as the generic external
# workload, we're just copying in our workload binary from the Pi build
# rather than the generic build.
dockerfile: Dockerfiles/Dockerfile.external-workload
ids:
- pi
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-pi-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-pi-workload:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-pi-workload:{{ .Version }}"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-pi-workload:latest"
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=EXTERNAL_BASE={{ .Env.EXTERNAL_BASE }}"
- use: buildx
goos: linux
goarch: arm64
# Not a typo! We really do use the same Dockerfile as the generic external
# workload, we're just copying in our workload binary from the Pi build
# rather than the generic build.
dockerfile: Dockerfiles/Dockerfile.bel-external-workload
ids:
- pi
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-pi-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-pi-workload:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-pi-workload:{{ .Version }}"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-pi-workload:latest"
build_flag_templates:
- "--platform=linux/arm64"
- "--build-arg=EXTERNAL_BASE={{ .Env.BEL_EXTERNAL_BASE }}"
docker_manifests:
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:{{ .Version }}"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:{{ .Version }}-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:latest"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-gui:latest-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:{{ .Version }}"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:{{ .Version }}-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:latest"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-workload:latest-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:{{ .Version }}"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:{{ .Version }}-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:latest"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-color:latest-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:latest"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:latest-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:{{ .Version }}"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-external-workload:{{ .Version }}-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:latest"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:latest-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:latest-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:{{ .Version }}"
image_templates:
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:{{ .Version }}-arm64"
- "{{ .Env.REGISTRY }}/{{ .Env.IMAGE_NAME }}-bel-external-workload:{{ .Version }}-amd64"
create_flags:
- --insecure
push_flags:
- --insecure
archives:
- id: generic
name_template: '{{ .ProjectName }}_generic_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
builds:
- generic-workload
- generic-color
- id: pi
name_template: '{{ .ProjectName }}_pi_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
builds:
- pi
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"