-
Notifications
You must be signed in to change notification settings - Fork 73
/
release.yml
580 lines (578 loc) · 18.1 KB
/
release.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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
variables:
- &go_linux_version
go_root: "/opt/golang/go1.23"
go_bin: "/opt/golang/go1.23/bin"
go_base_path: ""
- &go_windows_version
go_root: "c:\\golang\\go1.23"
go_bin: "c:\\golang\\go1.23\\bin"
go_base_path: "c:"
- &go_env
XDG_CONFIG_HOME: ${go_base_path}${workdir}
GO111MODULE: "on"
GOROOT: ${go_root}
GOPATH: ${go_base_path}${workdir}
ADD_PATH: "${go_bin}:${go_base_path}${workdir}/bin:${go_base_path}${workdir}/src/github.com/mongodb/mongodb-atlas-cli/bin"
- &go_options
add_to_path:
- ${go_bin}
- ${go_base_path}${workdir}/bin
- ${go_base_path}${workdir}/src/github.com/mongodb/mongodb-atlas-cli/bin
include_expansions_in_env:
- go_base_path
- workdir
working_dir: src/github.com/mongodb/mongodb-atlas-cli
env:
<<: *go_env
functions:
"install gh-token":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
script: |
set -Eeou pipefail
curl --output gh-token -sfL https://github.com/Link-/gh-token/releases/download/v2.0.1/linux-amd64
chmod 755 ./gh-token
"install goreleaser":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
script: |
set -Eeou pipefail
curl -sfL ${goreleaser_pro_tar_gz} | tar zx
"install macos notarization service":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
include_expansions_in_env:
- notary_service_url
script: |
set -Eeou pipefail
curl "${notary_service_url}" --output macos-notary.zip
unzip -u macos-notary.zip
chmod 755 ./linux_amd64/macnotary
"install curator":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli/bin
script: |
set -Eeou pipefail
curl -sL http://boxes.10gen.com/build/curator/curator-dist-rhel70-${curator_release|"latest"}.tar.gz | tar zx
"generate notices":
- command: subprocess.exec
type: test
params:
<<: *go_options
binary: build/package/generate-notices.sh
"package":
- command: github.generate_token
params:
expansion_name: github_token
- command: subprocess.exec
type: test
params:
<<: *go_options
env:
<<: *go_env
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
GITHUB_TOKEN: ${github_token}
include_expansions_in_env:
- go_base_path
- workdir
- notary_service_key_id
- notary_service_secret
- notary_service_url
- goreleaser_key
- unstable
binary: build/package/package.sh
"install go-msi":
- command: subprocess.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
command: choco install -y "go-msi" --force
"uninstall go-msi":
- command: subprocess.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
command: choco uninstall -y "go-msi"
"generate msi":
- command: subprocess.exec
type: test
params:
<<: *go_options
add_to_path:
- ${go_bin}
- ${go_base_path}${workdir}/bin
- ${go_base_path}${workdir}/src/github.com/mongodb/mongodb-atlas-cli/bin
- "/cygdrive/c/Program Files/go-msi"
- "/cygdrive/c/wixtools/bin"
env:
<<: *go_env
SECRET_API_KEY: ${chocolatey_api_key}
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
unstable: ${unstable}
command: bash.exe -c build/package/generate-msi.sh
"rename pkg":
- command: subprocess.exec
type: test
params:
<<: *go_options
include_expansions_in_env:
- go_base_path
- workdir
- unstable
- latest_deb
- latest_rpm
- package_name
- meta_package_name
binary: build/package/rename-pkg.sh
"send slack notification":
- command: subprocess.exec
type: test
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
silent: true
include_expansions_in_env:
- evergreen_user
- evergreen_api_key
- release_slack_channel
- revision
- created_at
- unstable
binary: build/package/send-slack-notification.sh
"generate download archive json":
- command: subprocess.exec
type: test
params:
<<: *go_options
working_dir: src/github.com/mongodb/mongodb-atlas-cli/dist
include_expansions_in_env:
- go_base_path
- workdir
- FEED_FILE_NAME
binary: ../build/package/generate-download-archive-manifest.sh
"upload dist":
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.tar.gz
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.zip
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.deb
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.rpm
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.tgz
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.json
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.msi
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.sig
remote_file: ${project}/dist/${revision}_${created_at}/
bucket: mongodb-mongocli-build
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: internal-bucket
"push":
- command: subprocess.exec
type: test
params:
<<: *go_options
include_expansions_in_env:
- go_base_path
- workdir
- barque_url
- distro
- edition
- server_version
- project
- revision
- created_at
- ext
- signing_auth_token_46
- signing_auth_token_50
- signing_auth_token_60
- signing_auth_token_70
- arch
env:
<<: *go_env
NOTARY_KEY_NAME: ${notary_key_name|server-5.0}
BARQUE_USERNAME: ${barque_user}
BARQUE_API_KEY: ${barque_api_key}
binary: build/package/curator-push.sh
"docker build":
- command: subprocess.exec
type: test
params:
include_expansions_in_env:
- project
- revision
- created_at
- image
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/package/docker
binary: ./docker-build.sh
"docker build meta":
- command: subprocess.exec
type: test
params:
include_expansions_in_env:
- project
- revision
- server_version
- created_at
- image
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/package/docker/meta
binary: ./docker-build.sh
"powershell build":
- command: subprocess.exec
type: test
params:
include_expansions_in_env:
- project
- revision
- created_at
- unstable
working_dir: src/github.com/mongodb/mongodb-atlas-cli/
binary: Powershell -File ./build/package/powershell/windows_post_package_test.ps1
"docker build repo":
- command: subprocess.exec
type: test
params:
include_expansions_in_env:
- image
- package
- server_version
- entrypoint
- mongo_package
- mongo_repo
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/package/docker/repo
binary: ./docker-build.sh
"build-copybara":
- command: subprocess.exec
params:
<<: *go_options
binary: git
args:
- clone
- --depth=1
- https://github.com/google/copybara
- ${workdir}/copybara
- command: subprocess.exec
params:
<<: *go_options
binary: docker
args:
- build
- -t
- google/copybara
- ${workdir}/copybara
"run-copybara":
- command: shell.exec
params:
<<: *go_options
env:
<<: *go_env
TAG: ${tag}
GH_TOKEN: ${gh_token}
WORKFLOW: ${workflow}
EVERGREEN_USER: ${evergreen_user}
EVERGREEN_API_KEY: ${evergreen_api_key}
DOCS_SLACK_CHANNEL: ${docs_slack_channel}
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci
shell: bash
script: |
./run-copybara.sh
tasks:
- name: package_msi
tags: ["packaging"]
depends_on:
- name: compile
variant: "code_health"
commands:
- func: "install go-msi"
- func: "generate msi"
vars:
unstable: ${unstable}
- func: "uninstall go-msi"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongodb-atlas-cli/bin/*.exe
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.msi
remote_file: ${project}/dist/${revision}_${created_at}/unsigned_
bucket: mongodb-mongocli-build
permissions: public-read
content_type: ${content_type|application/octet-stream}
display_name: unsigned
- name: package_goreleaser
tags: ["packaging"]
depends_on:
- name: compile
variant: "code_health"
commands:
- func: "generate notices"
- func: "install goreleaser"
- func: "install macos notarization service"
- func: "install gh-token"
- command: subprocess.exec
type: test
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
include_expansions_in_env:
- project
- revision
- created_at
env:
BUCKET: mongodb-mongocli-build
unstable: ${unstable}
binary: build/package/download-win-binaries.sh
- command: subprocess.exec
type: test
params:
include_expansions_in_env:
- unstable
env:
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
working_dir: src/github.com/mongodb/mongodb-atlas-cli
binary: build/package/windows_notarize.sh
- func: "package"
vars:
unstable: ${unstable}
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
- func: "rename pkg"
vars:
unstable: ${unstable}
latest_deb: ${latest_deb}
latest_rpm: ${latest_rpm}
package_name: ${package_name}
meta_package_name: ${meta_package_name}
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-deb-x86_64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/apt/x86_64
include:
- "*.deb"
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-deb-arm64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/apt/arm64
include:
- "*.deb"
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-rpm-x86_64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/yum/x86_64
include:
- "*.rpm"
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-rpm-aarch64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/yum/arm64
include:
- "*.rpm"
- func: "generate download archive json"
vars:
package_name: ${package_name}
FEED_FILE_NAME: "${package_name}.json"
- func: "upload dist"
- command: s3.put
params:
aws_key: ${download_center_aws_key}
aws_secret: ${download_center_aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.tar.gz
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.zip
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.deb
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.rpm
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.tgz
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.json
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.msi
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.sig
remote_file: mongocli/
build_variants:
- release_mongocli_github
- release_atlascli_github
bucket: downloads.mongodb.org
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: downloads-center-
- func: "send slack notification"
- name: push_atlascli_generate
patchable: false
stepback: false
commands:
- func: "generate evergreen"
vars:
task_type: snapshot
- name: push_stable_atlascli_generate
git_tag_only: true
stepback: false
commands:
- func: "generate evergreen"
vars:
task_type: publish
- name: pkg_test_atlascli_generate
tags: [ "smoke-test", "atlascli", "pkg" ]
commands:
- func: "generate evergreen"
vars:
task_type: postpkg
- name: pkg_test_repo_atlascli
patchable: false
git_tag_only: true
depends_on:
- name: package_goreleaser
variant: "release_atlascli_github"
tags: [ "smoke-test", "generate", "repo", "atlascli" ]
commands:
- func: "generate evergreen"
vars:
task_type: repo
- name: pkg_test_windows
tags: [ "smoke-test", "windows" ]
depends_on:
- name: package_goreleaser
variant: goreleaser_atlascli_snapshot
commands:
- func: "powershell build"
vars:
file: windows_post_package_test
- name: copybara
depends_on:
- name: package_goreleaser
variant: release_atlascli_github
commands:
- func: "build-copybara"
- command: github.generate_token
params:
expansion_name: docs_atlas_cli_token
owner: mongodb
repo: docs-atlas-cli
- func: "run-copybara"
vars:
gh_token: ${docs_atlas_cli_token}
workflow: docs-atlas-cli
- command: github.generate_token
params:
expansion_name: cloud_docs_token
owner: 10gen
repo: cloud-docs
- func: "run-copybara"
vars:
gh_token: ${cloud_docs_token}
workflow: cloud-docs
buildvariants:
- name: go_atlascli_msi_snapshot
display_name: "Packaging AtlasCLI (go-msi)"
run_on:
- windows-vsCurrent-small
expansions:
<<: *go_windows_version
unstable: -unstable
tasks:
- name: package_msi
- name: goreleaser_atlascli_snapshot
display_name: "Packaging AtlasCLI (goreleaser)"
run_on:
- rhel90-small
expansions:
<<: *go_linux_version
server_version: "4.4.0-rc3"
package_name: "mongodb-atlas-cli"
meta_package_name: "mongodb-atlas"
latest_deb: ~latest
latest_rpm: .latest
unstable: -unstable
tasks:
- name: package_goreleaser
depends_on:
- name: package_msi
variant: "go_atlascli_msi_snapshot"
- name: publish_atlascli_snapshot
display_name: "Publish AtlasCLI Snapshot"
run_on:
- rhel80-small
expansions:
<<: *go_linux_version
tasks:
- name: push_atlascli_generate
- name: release_atlascli_github
display_name: "Release AtlasCLI (goreleaser)"
git_tag_only: true
run_on:
- rhel90-small
expansions:
<<: *go_linux_version
server_version: "4.4.0-rc3"
package_name: "mongodb-atlas-cli"
meta_package_name: "mongodb-atlas"
tasks:
- name: package_goreleaser
depends_on:
- name: package_msi
variant: release_atlascli_msi
- name: copybara
display_name: "Copybara"
git_tag_only: true
run_on:
- ubuntu2404-small
expansions:
<<: *go_linux_version
tasks:
- name: copybara
- name: release_atlascli_msi
display_name: "Release AtlasCLI (go-msi)"
run_on:
- windows-vsCurrent-small
git_tag_only: true
expansions:
<<: *go_windows_version
tasks:
- name: package_msi
- name: release_atlascli_publish
display_name: "Publish AtlasCLI Generator"
run_on:
- rhel80-small
expansions:
<<: *go_linux_version
tasks:
- name: push_stable_atlascli_generate
- name: pkg_smoke_tests_docker_atlascli
display_name: "Post packaging smoke tests (Docker / AtlasCLI)"
run_on: ubuntu2004-small
expansions:
<<: *go_linux_version
tasks:
- name: .smoke-test .atlascli .pkg
- name: pkg_smoke_tests_windows_atlascli
display_name: "Post packaging smoke tests (Windows / AtlasCLI)"
run_on: windows-vsCurrent-small
expansions:
unstable: -unstable
tasks:
- name: .smoke-test .windows
- name: release_atlascli_repo_test
display_name: "Test AtlasCLI repo"
expansions:
<<: *go_linux_version
run_on:
- ubuntu2004-small
tasks:
- name: .smoke-test .generate .repo .atlascli