-
Notifications
You must be signed in to change notification settings - Fork 315
/
release_habitat.pipeline.yml
487 lines (437 loc) · 15 KB
/
release_habitat.pipeline.yml
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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
expeditor:
secrets:
PIPELINE_HAB_AUTH_TOKEN:
path: account/static/habitat/chef-ci
field: auth_token # Production Builder
# acceptance_auth_token = acceptance
accounts:
- aws/chef-cd
defaults:
buildkite:
timeout_in_minutes: 45
env:
HAB_ORIGIN: "core"
PIPELINE_HAB_BLDR_URL: "https://bldr.habitat.sh"
# Necessary to prevent old studios from poisoning builds after core plans refreshes
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "LTS-2024"
HAB_STUDIO_SECRET_HAB_FEAT_IGNORE_LOCAL: "true"
HAB_STUDIO_SECRET_HAB_REFRESH_CHANNEL: "LTS-2024"
steps:
#######################################################################
# Release!
#######################################################################
- label: "[:linux: build hab (ARM)]"
command:
- .expeditor/scripts/release_habitat/package_and_upload_arm_binary.sh
agents:
queue: docker-linux-arm64
- label: "[:linux: build hab]"
command:
- .expeditor/scripts/release_habitat/build_component.sh hab
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: build hab]"
command:
- .expeditor/scripts/release_habitat/build_component.sh hab
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- label: "[:windows: build hab]"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 hab
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- label: "[:mac: x86_64 build hab]"
command:
# We need to install bash 4+ so we are able to use all the modern capabilities.
- brew install bash
- .expeditor/scripts/release_habitat/build_mac_hab_binary.sh
env:
BUILD_PKG_TARGET: "x86_64-darwin"
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_AUTO_UPDATE: 1
expeditor:
executor:
macos:
os-version: "12"
inherit-environment-vars: true
timeout_in_minutes: 60
retry:
automatic:
limit: 10 # Addressing current Anka system timeouts due to oversubscription
- label: "[:mac: aarch64 build hab]"
command:
# We need to install bash 4+ so we are able to use all the modern capabilities.
- brew install bash
- .expeditor/scripts/release_habitat/build_mac_hab_binary.sh
env:
BUILD_PKG_TARGET: "aarch64-darwin"
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_AUTO_UPDATE: 1
expeditor:
executor:
macos:
os-version: "12"
inherit-environment-vars: true
timeout_in_minutes: 60
retry:
automatic:
limit: 10 # Addressing current Anka system timeouts due to oversubscription
- wait
- label: "[:linux: build hab-plan-build]"
command:
- .expeditor/scripts/release_habitat/build_component.sh plan-build
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: build hab-plan-build]"
command:
- .expeditor/scripts/release_habitat/build_component.sh plan-build
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- label: "[:windows: build plan-build-ps1]"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 plan-build-ps1
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- wait
- label: "[:linux: build hab-backline]"
command:
- .expeditor/scripts/release_habitat/build_component.sh backline
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: build hab-backline]"
command:
- .expeditor/scripts/release_habitat/build_component.sh backline
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- wait
- label: "[:linux: build hab-studio]"
command:
- .expeditor/scripts/release_habitat/build_component.sh studio
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: build hab-studio]"
command:
- .expeditor/scripts/release_habitat/build_component.sh studio
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- label: "[:windows: build studio]"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 studio
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- wait
# Now that we've got a new Studio, we can build everything else
# using the build toolchain we just built.
- label: "[:linux: build launcher]"
command:
- .expeditor/scripts/release_habitat/build_component.sh launcher
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: build launcher]"
command:
- .expeditor/scripts/release_habitat/build_component.sh launcher
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- label: "[:windows: build launcher]"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 launcher
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- label: "[:linux: build hab-sup]"
command:
- .expeditor/scripts/release_habitat/build_component.sh sup
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: build hab-sup]"
command:
- .expeditor/scripts/release_habitat/build_component.sh sup
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- label: "[:windows: build hab-sup]"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 sup
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- label: "[:linux: build hab-pkg-export-container]"
command:
- .expeditor/scripts/release_habitat/build_component.sh pkg-export-container
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:windows: build hab-pkg-export-container]"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 pkg-export-container
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- label: "[:linux: build hab-pkg-export-tar]"
command:
- .expeditor/scripts/release_habitat/build_component.sh pkg-export-tar
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: build hab-pkg-export-tar]"
command:
- .expeditor/scripts/release_habitat/build_component.sh pkg-export-tar
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- label: "[:windows: build hab-pkg-export-tar]"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 pkg-export-tar
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- wait
# Windows Service must be built after the Windows Launcher
- label: ":windows: Build windows service"
command:
- powershell .expeditor/scripts/release_habitat/build_component.ps1 windows-service
expeditor:
executor:
docker:
host_os: windows
environment:
- BUILD_PKG_TARGET=x86_64-windows
- BUILDKITE_AGENT_ACCESS_TOKEN
- wait
# TODO (CM): It wouldn't take too much additional work to have
# `package_and_upload_binary.sh` operate on ALL targets at once.
# All the package-and-upload steps should be disabled on
# manually-triggered pipeline runs... we don't want to pollute
# packages.chef.io with random build artifacts.
- label: "[:linux: upload hab binary]"
command:
- .expeditor/scripts/release_habitat/package_and_upload_binary.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
- label: "[:linux: :two: upload hab binary]"
command:
- .expeditor/scripts/release_habitat/package_and_upload_binary.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
env:
HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL: "stable"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux-kernel2
- label: "[:windows: upload hab binary]"
command:
- .expeditor/scripts/release_habitat/package_and_upload_binary.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-windows
- label: "[:mac: x86_64 upload hab binary]"
command:
- .expeditor/scripts/release_habitat/package_and_upload_binary.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-darwin
- label: "[:mac: aarch64 upload hab binary]"
command:
- .expeditor/scripts/release_habitat/package_and_upload_binary.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=aarch64-darwin
- label: "Update Habitat Documentation"
command:
- .expeditor/scripts/release_habitat/update_documentation.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
artifact_paths:
# See update_documentation.sh script for the naming of this path.
- "generated-documentation/**"
expeditor:
executor:
docker:
privileged: true
environment:
- BUILD_PKG_TARGET=x86_64-linux
# It is VERY IMPORTANT that Docker container uploads ARE NOT active
# in manually-triggered pipeline runs (at least, not without GREAT
# CARE and knowledge of *exactly* what you are doing.)
#
# The issue is that they are tagged according to the current version
# (i.e., the VERSION file). If you manually trigger this pipeline,
# chances are you're doing it on a PR. Imagine that your PR happens
# to be branched off of master at the last stable release. As a
# result, it will have the same version as what is currently
# released. Were you to upload to DockerHub, you would end up
# overwriting the existing container with your new one, containing
# who knows what.
#
# Until we no longer have such tight version coupling with the
# studio and / or we get an internal container registry to push
# pre-release container images to, these steps should only be
# executed during "real" runs of this pipeline.
- label: ":docker: Upload containers to Docker Hub"
command: .expeditor/scripts/release_habitat/dockerhub_upload.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
env:
BUILD_PKG_TARGET: "x86_64-linux"
expeditor:
executor:
linux:
privileged: true
- label: ":docker: :two: Upload containers to Docker Hub"
command: .expeditor/scripts/release_habitat/dockerhub_upload.sh
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
env:
BUILD_PKG_TARGET: "x86_64-linux-kernel2"
expeditor:
executor:
linux:
privileged: true
- label: ":docker: :windows: Upload windows 2016 container to Docker Hub"
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
command: .expeditor/scripts/release_habitat/publish_docker_studio.ps1
expeditor:
executor:
windows:
os_version: 2016
- label: ":docker: :windows: Upload windows 2019 container to Docker Hub"
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
command: .expeditor/scripts/release_habitat/publish_docker_studio.ps1
expeditor:
executor:
windows:
os_version: 2019
- label: ":docker: :windows: Upload windows 2022 container to Docker Hub"
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
command: .expeditor/scripts/release_habitat/publish_docker_studio.ps1
expeditor:
executor:
windows:
os_version: 2022
- wait
- label: "[:habicat: Generate Manifest and promote to dev channel]"
command:
- .expeditor/scripts/release_habitat/promote_artifacts_to_dev.sh habitat-release-$BUILDKITE_BUILD_ID
# Only "real" executions of this pipeline, initiated by Expeditor, should promote anything
if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true'
expeditor:
executor:
docker:
privileged: true