@@ -51,22 +51,10 @@ functions:
51
51
52
52
# ## Setup Functions ###
53
53
54
- setup_jq : &setup_jq
55
- command : subprocess.exec
56
- type : setup
57
- params :
58
- << : *e2e_include_expansions_in_env
59
- add_to_path :
60
- - ${workdir}/bin
61
- working_dir : src/github.com/mongodb/mongodb-kubernetes
62
- binary : scripts/evergreen/setup_jq.sh
63
-
64
54
setup_context : &setup_context # Running the first switch is important to fill the workdir and other important initial env vars
65
55
command : shell.exec
66
56
type : setup
67
57
params :
68
- add_to_path :
69
- - ${workdir}/bin
70
58
shell : bash
71
59
working_dir : src/github.com/mongodb/mongodb-kubernetes
72
60
<< : *e2e_include_expansions_in_env
@@ -115,7 +103,6 @@ functions:
115
103
type : setup
116
104
params :
117
105
command :
" git config --global user.email '[email protected] '"
118
- - *setup_jq # we need jq in the context
119
106
- *setup_context
120
107
121
108
setup_kubectl : &setup_kubectl
@@ -125,6 +112,13 @@ functions:
125
112
working_dir : src/github.com/mongodb/mongodb-kubernetes
126
113
binary : scripts/evergreen/setup_kubectl.sh
127
114
115
+ setup_jq : &setup_jq
116
+ command : subprocess.exec
117
+ type : setup
118
+ params :
119
+ working_dir : src/github.com/mongodb/mongodb-kubernetes
120
+ binary : scripts/evergreen/setup_jq.sh
121
+
128
122
setup_shellcheck :
129
123
command : subprocess.exec
130
124
type : setup
@@ -231,7 +225,7 @@ functions:
231
225
working_dir : src/github.com/mongodb/mongodb-kubernetes
232
226
add_to_path :
233
227
- ${workdir}/bin
234
- binary : scripts/dev/configure_container_auth .sh
228
+ binary : scripts/dev/configure_docker_auth .sh
235
229
236
230
setup_evg_host : &setup_evg_host
237
231
command : subprocess.exec
@@ -262,35 +256,16 @@ functions:
262
256
# Configures docker authentication to ECR and RH registries.
263
257
setup_building_host :
264
258
- *switch_context
265
- - *python_venv
266
259
- *setup_aws
267
- - *setup_evg_host
268
260
- *configure_docker_auth
269
-
270
- # This differs for normal evg_host as we require minikube instead of kind for
271
- # IBM machines also install aws cli via pip instead and use podman
272
- setup_building_host_minikube :
273
- - *switch_context
274
- - command : subprocess.exec
275
- type : setup
276
- params :
277
- working_dir : src/github.com/mongodb/mongodb-kubernetes
278
- add_to_path :
279
- - ${workdir}/bin
280
- command : scripts/evergreen/setup_minikube_host.sh
261
+ - *setup_evg_host
262
+ - *python_venv
281
263
282
264
prune_docker_resources :
283
- - command : shell .exec
265
+ - command : subprocess .exec
284
266
type : setup
285
267
params :
286
- shell : bash
287
- script : |
288
- if command -v docker >/dev/null 2>&1; then
289
- echo "Docker found, pruning docker resources..."
290
- docker system prune -a -f
291
- else
292
- echo "Docker not found, skipping docker resource pruning"
293
- fi
268
+ command : " docker system prune -a -f"
294
269
295
270
# the task configures the set of tools necessary for any task working with K8 cluster:
296
271
# installs kubectl, jq, kind (if necessary), configures docker authentication
@@ -352,19 +327,20 @@ functions:
352
327
shell : bash
353
328
working_dir : src/github.com/mongodb/mongodb-kubernetes
354
329
script : |
355
- scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py create
330
+ source .generated/context.export.env
331
+ scripts/evergreen/e2e/setup_cloud_qa.py create
356
332
# The additional switch is needed, since we now have created the needed OM exports.
357
333
- *switch_context
358
334
359
335
teardown_cloud_qa :
360
336
- command : shell.exec
361
337
type : setup
362
338
params :
363
- continue_on_err : true
364
339
shell : bash
365
340
working_dir : src/github.com/mongodb/mongodb-kubernetes
366
341
script : |
367
- scripts/dev/run_python.sh scripts/evergreen/e2e/setup_cloud_qa.py delete
342
+ source .generated/context.export.env
343
+ scripts/evergreen/e2e/setup_cloud_qa.py delete
368
344
369
345
dump_diagnostic_information_from_all_namespaces :
370
346
- command : subprocess.exec
@@ -444,7 +420,6 @@ functions:
444
420
upload_e2e_logs :
445
421
- command : s3.put
446
422
params :
447
- continue_on_err : true
448
423
aws_key : ${enterprise_aws_access_key_id}
449
424
aws_secret : ${enterprise_aws_secret_access_key}
450
425
local_files_include_filter :
@@ -456,7 +431,6 @@ functions:
456
431
content_type : text/plain
457
432
- command : attach.xunit_results
458
433
params :
459
- continue_on_err : true
460
434
file : " src/github.com/mongodb/mongodb-kubernetes/logs/myreport.xml"
461
435
462
436
upload_e2e_logs_gotest :
@@ -530,39 +504,47 @@ functions:
530
504
- ${workdir}/bin
531
505
- ${workdir}
532
506
533
- build_test_image_ibm :
507
+ pipeline :
534
508
- *switch_context
535
- - command : subprocess.exec
509
+ - command : shell.exec
510
+ type : setup
536
511
params :
537
512
shell : bash
538
- working_dir : src/github.com/mongodb/mongodb-kubernetes
539
- include_expansions_in_env :
540
- - version_id
541
- add_to_path :
542
- - ${workdir}/bin
543
- binary : scripts/evergreen/e2e/build_tests_image_ibm.sh
544
-
545
- pipeline_migrate_agents :
546
- - *switch_context
513
+ script : |
514
+ # Docker Hub workaround
515
+ # docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
516
+ docker buildx create --driver=docker-container --driver-opt=image=268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/moby/buildkit:buildx-stable-1 --use
517
+ docker buildx inspect --bootstrap
547
518
- command : subprocess.exec
548
- retry_on_failure : false
519
+ retry_on_failure : true
549
520
type : setup
550
521
params :
551
522
shell : bash
552
523
<< : *e2e_include_expansions_in_env
553
524
working_dir : src/github.com/mongodb/mongodb-kubernetes
554
- binary : scripts/release/pipeline_migrate_agent .sh
525
+ binary : scripts/dev/run_python .sh scripts/release/pipeline_main.py --parallel ${image_name}
555
526
556
- pipeline :
527
+ release_pipeline :
557
528
- *switch_context
529
+ - command : shell.exec
530
+ type : setup
531
+ params :
532
+ shell : bash
533
+ script : |
534
+ # Docker Hub workaround
535
+ # docker buildx needs the moby/buildkit image when setting up a builder so we pull it from our mirror
536
+ docker buildx create --driver=docker-container --driver-opt=image=268558157000.dkr.ecr.eu-west-1.amazonaws.com/docker-hub-mirrors/moby/buildkit:buildx-stable-1 --use
537
+ docker buildx inspect --bootstrap
558
538
- command : subprocess.exec
559
539
retry_on_failure : true
560
540
type : setup
561
541
params :
562
542
shell : bash
563
543
<< : *e2e_include_expansions_in_env
564
544
working_dir : src/github.com/mongodb/mongodb-kubernetes
565
- binary : scripts/dev/run_python.sh scripts/release/pipeline_main.py --parallel ${image_name} ${all_agents} ${build_scenario}
545
+ env :
546
+ git_tag : ${triggered_by_git_tag}
547
+ binary : scripts/dev/run_python.sh scripts/release/pipeline_main.py ${image_name} --build-scenario release --version ${git_tag}
566
548
567
549
# TODO: CLOUDP-335471 ; once all image builds are made with the new atomic pipeline, remove the following function
568
550
legacy_pipeline :
@@ -845,3 +827,65 @@ functions:
845
827
- task_name
846
828
script : |
847
829
./scripts/code_snippets/${task_name}_test.sh
830
+
831
+ #
832
+ # kubectl mongodb plugin release functions
833
+ #
834
+ install_goreleaser :
835
+ - command : shell.exec
836
+ type : setup
837
+ include_expansions_in_env :
838
+ - goreleaser_pro_tar_gz
839
+ params :
840
+ script : |
841
+ set -Eeu pipefail
842
+ curl -fL "${goreleaser_pro_tar_gz}" --output goreleaser_Linux_x86_64.tar.gz
843
+ tar -xf goreleaser_Linux_x86_64.tar.gz
844
+ chmod 755 ./goreleaser
845
+
846
+ install_macos_notarization_service :
847
+ - command : shell.exec
848
+ type : setup
849
+ params :
850
+ include_expansions_in_env :
851
+ - notary_service_url
852
+ script : |
853
+ set -Eeu pipefail
854
+
855
+ curl "${notary_service_url}" --output macos-notary.zip
856
+ unzip -u macos-notary.zip
857
+ chmod 755 ./linux_amd64/macnotary
858
+
859
+ release_kubectl_mongodb_plugin :
860
+ - command : github.generate_token
861
+ params :
862
+ expansion_name : generated_token
863
+ - command : shell.exec
864
+ type : setup
865
+ params :
866
+ working_dir : src/github.com/mongodb/mongodb-kubernetes
867
+ include_expansions_in_env :
868
+ - GRS_USERNAME
869
+ - GRS_PASSWORD
870
+ - PKCS11_URI
871
+ - ARTIFACTORY_URL
872
+ - ARTIFACTORY_PASSWORD
873
+ - SIGNING_IMAGE_URI
874
+ - macos_notary_keyid
875
+ - macos_notary_secret
876
+ - workdir
877
+ - triggered_by_git_tag
878
+ env :
879
+ XDG_CONFIG_HOME : ${go_base_path}${workdir}
880
+ GO111MODULE : " on"
881
+ GOROOT : " /opt/golang/go1.24"
882
+ MACOS_NOTARY_KEY : ${macos_notary_keyid}
883
+ MACOS_NOTARY_SECRET : ${macos_notary_secret}
884
+ GORELEASER_CURRENT_TAG : ${triggered_by_git_tag}
885
+ # shell.exec EVG Task doesn't have add_to_path, so we need to explicitly add the path export below.
886
+ script : |
887
+ set -Eeu pipefail
888
+
889
+ export PATH=$GOROOT/bin:$PATH
890
+ export GITHUB_TOKEN=${generated_token}
891
+ ${workdir}/goreleaser release --clean
0 commit comments