-
Notifications
You must be signed in to change notification settings - Fork 357
/
common.yml
2506 lines (2332 loc) · 69.3 KB
/
common.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
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#######################################
# Tools Driver Config for MCI #
#######################################
# default command type
command_type: system
# 3 hour default timeout
exec_timeout_secs: 10800
# run the same task in the previous revision if the current task fails
stepback: true
variables:
# Common mongodb arguments
mongod_arguments:
default: &mongod_default_startup_args
mongod_args: ""
mongod_port: 33333
ssl: &mongod_ssl_startup_args
mongod_args: "--sslMode requireSSL --sslCAFile common/db/testdata/ca-ia.pem --sslPEMKeyFile common/db/testdata/test-server.pem"
replsettest_ssl_config: "sslMode: \\\"requireSSL\\\",sslPEMKeyFile: \\\"common/db/testdata/test-server.pem\\\", sslCAFile: \\\"common/db/testdata/ca-ia.pem\\\", sslAllowInvalidHostnames: \\\"\\\""
mongod_port: 33333
tls: &mongod_tls_startup_args
mongod_args_tls: "--tlsMode requireTLS --tlsCAFile common/db/testdata/ca-ia.pem --tlsCertificateKeyFile common/db/testdata/test-server.pem"
replsettest_tls_config: "tlsMode: \\\"requireTLS\\\",tlsCertificateKeyFile: \\\"common/db/testdata/test-server.pem\\\", tlsCAFile: \\\"common/db/testdata/ca-ia.pem\\\", tlsAllowInvalidHostnames: \\\"\\\""
mongod_port: 33333
mongo_arguments:
default: &mongo_default_startup_args
mongo_args: &mongo_default_startup_args_string "--port 33333"
mongod_port: 33333
ssl: &mongo_ssl_startup_args
mongo_args: "--port 33333 --ssl --sslCAFile common/db/testdata/ca-ia.pem --sslPEMKeyFile common/db/testdata/test-server.pem --sslAllowInvalidCertificates"
mongod_port: 33333
tls: &mongo_tls_startup_args
mongo_args_tls: "--port 33333 --tls --tlsCAFile common/db/testdata/ca-ia.pem --tlsCertificateKeyFile common/db/testdata/test-server.pem --tlsAllowInvalidCertificates"
mongod_port: 33333
parameters:
- key: fake_tag_for_release_testing
description: |
This can be set to test tasks that require a tag without actually
triggering all of the release automation. Setting it will cause the
`EVG_TRIGGERED_BY_TAG` environment variable to be populated with this
parameter's value.
functions:
"run legacy tests":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
chmod +x bin/*
mv bin/* ${test_path}/
cd ${test_path}
./mongo --nodb lib/run_mongod.js jstests/tool/*.js
"run qa-tests":
command: subprocess.exec
params:
binary: bash
working_dir: src/github.com/mongodb/mongo-tools
args:
- "./scripts/run_qa.sh"
add_expansions_to_env: true
"run native-cert-ssl":
command: subprocess.exec
params:
binary: bash
working_dir: src/github.com/mongodb/mongo-tools
args:
- "./scripts/run_native_cert_ssl.sh"
add_expansions_to_env: true
"run make target":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
${_maybe_enable_devtoolset_7}
PATH=$PATH:$HOME
go run build.go -v ${target}
"download mongod and shell":
- command: github.generate_token
params:
owner: 10gen
repo: mongo-release
expansion_name: generated_token_mongo_release
permissions:
contents: read
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
${_maybe_enable_devtoolset_7}
PATH=$PATH:$HOME
go run release/release.go download-mongod-and-shell --server-version ${mongo_version}
add_expansions_to_env: true
"get buildnumber":
command: keyval.inc
params:
key: "${build_variant}_tools"
destination: "builder_num"
"setup integration test":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
# Set up Kerberos stuff: run kinit if necessary, and add KDC to registry
# on Windows (see https://wiki.mongodb.com/display/DH/Testing+Kerberos)
script: |
set -e
# export sensitive info before `set -x`
if [ '${run_kinit}' = 'true' ]; then
# BUILD-3830
mkdir -p "$(pwd)/.evergreen"
touch "$(pwd)/.evergreen/krb5.conf.empty"
export KRB5_CONFIG="$(pwd)/.evergreen/krb5.conf.empty"
echo "Writing keytab"
echo ${kerberos_keytab} | base64 -d > "$(pwd)/.evergreen/drivers.keytab"
echo "Running kinit"
kinit -k -t "$(pwd)/.evergreen/drivers.keytab" -p drivers@LDAPTEST.10GEN.CC;
fi;
set -x
set -v
if [ "Windows_NT" = "$OS" ]; then
cmd /c "REG ADD HKLM\SYSTEM\ControlSet001\Control\Lsa\Kerberos\Domains\LDAPTEST.10GEN.CC /v KdcNames /d ldaptest.10gen.cc /t REG_MULTI_SZ /f"
fi;
"setup credentials":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
silent: true
script: |
set -x
set -v
set -e
cat > mci.buildlogger <<END_OF_CREDS
slavename='${slave}'
passwd='${passwd}'
builder='MCI_${build_variant}'
build_num=${builder_num}
build_phase='${task_name}_${execution}'
END_OF_CREDS
# Resmoke hardcodes the location of this file so we need to copy it to the working directory
# we run resmoke from.
cp mci.buildlogger test/qa-tests
"start mongod":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
background: true
script: |
set -x
set -v
set -e
rm -rf mongodb/db_files mongodb/${logfile|run.log}
mkdir -p mongodb/db_files
MONGOD_ARGS="${mongod_args}"
if [ "${USE_TLS}" = "true" ]; then
MONGOD_ARGS="${mongod_args_tls}"
elif [ "${AWS_AUTH}" = "true" ]; then
MONGOD_ARGS="--auth --setParameter authenticationMechanisms=MONGODB-AWS,SCRAM-SHA-256"
fi;
echo "Starting mongod..."
storage_args=''
if [ "${STORAGE_ENGINE}" != '' ]; then
storage_args='--storageEngine ${STORAGE_ENGINE}'
fi
PATH=$PWD/bin:$PATH ./bin/mongod${extension} --port ${mongod_port} $MONGOD_ARGS ${additional_args} --dbpath mongodb/db_files --setParameter=enableTestCommands=1 $storage_args
"wait for mongod to be ready":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
SECS=0
MONGO_ARGS="${mongo_args}"
if [ "${USE_TLS}" = "true" ]; then
MONGO_ARGS="${mongo_args_tls}"
elif [ "${AWS_AUTH}" = "true" ]; then
MONGO_ARGS="--port 33333"
fi;
while true ; do
set -o verbose
./bin/mongo${extension} $MONGO_ARGS --eval 'true;'
if [ "$?" = "0" ]; then
echo "mongod ready";
exit 0
else
SECS=`expr $SECS + 1`
if [ $SECS -gt 100 ]; then
echo "mongod not ready after 100 seconds"
exit 1
fi
echo "waiting for mongod $MONGO_ARGS to be ready..." ;
sleep 1 ;
fi
done
"create mongod users":
command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
MONGO_ARGS="${mongo_args}"
if [ "${USE_TLS}" = "true" ]; then
MONGO_ARGS="${mongo_args_tls}"
fi
echo "db.createUser({ user: '${auth_username}', pwd: '${auth_password}', roles: [{ role: '__system', db: 'admin' }] });" | ./bin/mongo${extension} $MONGO_ARGS admin
"create release artifacts":
# build release artifacts
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
${_maybe_enable_devtoolset_7}
PATH=$PATH:$HOME
go run release/release.go build-archive
go run release/release.go build-packages
# temporary workaround for TOOLS-2606
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
rm -rf ./mongorestore/testdata/longcollectionname/
# upload individual release artifacts to task page
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.deb
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.msi
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.rpm
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.tgz
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.zip
remote_file: mongo-tools/pkgs/${build_id}/
content_type: application/octet-stream
bucket: mciuploads
permissions: public-read
display_name: "Release Artifact - "
# pack all release artifacts into a tarball and upload them to one
# place so that they can be more easily downloaded by the sign task
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongo-tools/upload.tgz
source_dir: src/github.com/mongodb/mongo-tools
include:
- mongodb-database-tools*.deb
- mongodb-database-tools*.msi
- mongodb-database-tools*.rpm
- mongodb-database-tools*.tgz
- mongodb-database-tools*.zip
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/upload.tgz
remote_file: mongo-tools/task/dist/${build_id}/all-release-artifacts.tgz
content_type: application/x-gzip
bucket: mciuploads
permissions: public-read
display_name: All Release Artifacts (.tgz)
"fetch dist release artifacts":
- command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
remote_file: mongo-tools/task/dist/${build_id}/all-release-artifacts.tgz
extract_to: src/github.com/mongodb/mongo-tools/
bucket: mciuploads
"sign artifacts":
command: subprocess.exec
params:
binary: bash
working_dir: src/github.com/mongodb/mongo-tools
env:
MONGO_OS: ${mongo_os}
MACOS_NOTARY_KEY: ${MACOS_NOTARY_KEY}
MACOS_NOTARY_SECRET: ${MACOS_NOTARY_SECRET}
ARTIFACTORY_PASSWORD: ${artifactory_password}
ARTIFACTORY_USERNAME: ${artifactory_username}
GARASIGN_PASSWORD: ${garasign_password}
GARASIGN_USERNAME: ${garasign_username}
TASK_ID: ${task_id}
args:
- "./scripts/sign_artifacts.sh"
"upload signed release artifacts":
# temporary workaround for TOOLS-2606
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
rm -rf ./mongorestore/testdata/longcollectionname/
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.sig
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.deb
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.msi
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.rpm
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.tgz
- src/github.com/mongodb/mongo-tools/mongodb-database-tools*.zip
remote_file: mongo-tools/task/sign/${build_id}/
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream
"upload release packages to s3":
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
go run release/release.go upload-release
"upload release json feed to s3":
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
go run release/release.go upload-json
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/github.com/mongodb/mongo-tools/release.json
remote_file: mongo-tools/release/${build_id}/
optional: true
content_type: application/json
bucket: mciuploads
permissions: public-read
"generate full JSON feed":
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
go run release/release.go generate-full-json
"upload release packages to linux repos":
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
curl -L -O http://boxes.10gen.com/build/curator/curator-dist-rhel70-latest.tar.gz
tar -zxvf curator-dist-rhel70-latest.tar.gz
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
go run release/release.go linux-release
"fetch source":
- command: shell.exec
params:
script: |
set -x
set -v
set -e
mkdir -p src/github.com/mongodb
- command: git.get_project
params:
directory: src/github.com/mongodb/mongo-tools
- command: git.apply_patch
params:
directory: src/github.com/mongodb/mongo-tools
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
mkdir -p bin
"create repl_set":
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
background: true
script: |
set -x
set -v
set -e
echo "starting repl set"
MONGO_ARGS="${mongo_args}"
NODE_OPTIONS=""
mkdir -p /data/db/
if [ "${USE_TLS}" = "true" ]; then
NODE_OPTIONS="${replsettest_tls_config}"
MONGO_ARGS="${mongo_args_tls}"
elif [ "${USE_SSL}" = "true" ]; then
NODE_OPTIONS="${replsettest_ssl_config}"
fi
PATH=./bin:$PATH ./bin/mongo $MONGO_ARGS --nodb --eval 'TestData = new Object(); TestData.minPort="${mongod_port}"; var repl = new ReplSetTest({nodes:1, name:"repltester", nodeOptions: {'"$NODE_OPTIONS"'}});repl.startSet();repl.initiate();repl.awaitSecondaryNodes();while(true){sleep(1000);}'
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
set -x
set -v
set -e
MONGO_ARGS="${mongo_args}"
if [ "${USE_TLS}" = "true" ]; then
MONGO_ARGS="${mongo_args_tls}"
fi;
./bin/mongo $MONGO_ARGS --nodb --eval 'assert.soon(function(x){try{var d = new Mongo("localhost:${mongod_port}"); return true} catch(e){return false}}, "timed out connection")'
"add-aws-auth-variables-to-file":
- command: shell.exec
type: test
params:
silent: true
working_dir: src/github.com/mongodb/mongo-tools/common/testdata/lib
script: |
set -x
set -v
set -e
cat <<EOF > $(pwd)/aws_e2e_setup.json
{
"iam_auth_assume_aws_account": "${iam_auth_assume_aws_account}",
"iam_auth_assume_aws_secret_access_key": "${iam_auth_assume_aws_secret_access_key}",
"iam_auth_assume_role_name": "${iam_auth_assume_role_name}"
}
EOF
"setup-aws-auth-test-with-assume-role-credentials":
- command: shell.exec
type: test
params:
# silent: true
working_dir: src/github.com/mongodb/mongo-tools/common/testdata/lib
script: |
set -x
set -v
set -e
# The aws_e2e_assume_role script requires python3 with boto3.
# Set up or use an existing python virtualenv for boto3.
venv='venv'
venvNonWindows () { . "$venv"/bin/activate; python3 -m pip install boto3; }
venvWindows () { . "$venv"/Scripts/activate; pip install boto3; }
# default to python3 inside mongodbtoolchain
PATH=/opt/mongodbtoolchain/v3/bin/:$PATH
if [ -f "$venv"/bin/activate ]; then
echo 'activating existing virtualenv'
venvNonWindows
elif [ -f "$venv"/Scripts/activate ]; then
echo 'activating existing virtualenv'
venvWindows
elif virtualenv "$venv" || python -m virtualenv "$venv"; then
echo 'creating new virtualenv'
if [ -f "$venv"/bin/activate ]; then
echo 'activating new virtualenv'
venvNonWindows
elif [ -f "$venv"/Scripts/activate ]; then
echo 'activating new virtualenv'
venvWindows
fi
fi
pip list
../../../bin/mongo --nodb aws_e2e_assume_role.js
- command: shell.exec
type: test
params:
silent: true
working_dir: src/github.com/mongodb/mongo-tools/common/testdata/lib
script: |
set -x
set -v
set -e
jsonkey () { python -c "import sys, json; sys.stdout.write(json.load(sys.stdin)['$1'])" < creds.json; }
urlencode () { python -c "import sys, urllib as ul; sys.stdout.write(ul.quote_plus('$1'))"; }
USER=$(jsonkey AccessKeyId)
USER=$(urlencode $USER)
PASS=$(jsonkey SecretAccessKey)
PASS=$(urlencode $PASS)
MONGOD_URI="mongodb://$USER:$PASS@localhost:33333/?authMechanism=MONGODB-AWS"
SESSION_TOKEN=$(jsonkey SessionToken)
SESSION_TOKEN=$(urlencode $SESSION_TOKEN)
if [ -n $SESSION_TOKEN ]; then
MONGOD_URI="$MONGOD_URI&authMechanismProperties=AWS_SESSION_TOKEN:$SESSION_TOKEN"
fi
echo -n "$MONGOD_URI" > MONGOD_URI
"check sbom lite":
command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
./scripts/regenerate-and-diff-sbom-lite.sh
"generate gosec SARIF report":
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
set -x
set -v
set -e
GOSEC_SARIF_REPORT=1 ./dev-bin/precious lint --all --command gosec
cat SARIF.json
"create evergreen config file":
- command: shell.exec
type: test
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
set -x
set -v
set -e
./scripts/write-evergreen-config-file.sh
pre:
- command: shell.exec
params:
silent: true
script: |
set -x
set -v
${killall_mci|pkill -9 mongo; pkill -9 mongodump; pkill -9 mongoexport; pkill -9 mongoimport; pkill -9 mongofiles; pkill -9 mongorestore; pkill -9 mongostat; pkill -9 mongotop; pkill -9 mongod; pkill -9 mongos; pkill -f buildlogger.py; pkill -f smoke.py} >/dev/null 2>&1
rm -rf src /data/db/*
exit 0
- command: shell.exec
params:
script: |
cat <<EOT > expansions.yml
_set_shell_env: |
. ./set_goenv.sh
GOROOT=""; set_goenv || exit
export EVG_IS_PATCH='${is_patch}'
export EVG_TRIGGERED_BY_TAG='${triggered_by_git_tag}'
if [ -n "${fake_tag_for_release_testing}" ]; then
export EVG_TRIGGERED_BY_TAG="${fake_tag_for_release_testing}"
export IS_FAKE_TAG=1
fi
export EVG_BUILD_ID='${build_id}'
export EVG_VERSION='${version_id}'
export EVG_VARIANT='${build_variant}'
if [ '${_platform}' != '' ]; then
export EVG_VARIANT='${_platform}'
fi
export EVG_USER='${evg_user}'
export EVG_KEY='${evg_key}'
export EVG_TASK_ID='${task_id}'
export AWS_ACCESS_KEY_ID='${release_aws_access_key_id}'
export AWS_SECRET_ACCESS_KEY='${release_aws_secret}'
export BARQUE_USERNAME='${barque_username}'
export BARQUE_API_KEY='${barque_api_key}'
export TOOLS_TESTING_AUTH_USERNAME='${auth_username}'
export TOOLS_TESTING_AUTH_PASSWORD='${auth_password}'
export MONGODB_KERBEROS_PASSWORD='${kerberos_password}'
export TOOLS_TESTING_PKCS8_PASSWORD='${pkcs8_password}'
export SNYK_TOKEN='${snyk_token}'
export SILK_CLIENT_ID='${silk_client_id}'
export SILK_CLIENT_SECRET='${silk_client_secret}'
set -o xtrace
set -o verbose
set -o errexit
_maybe_enable_devtoolset_7: |
if [ -f /opt/rh/devtoolset-7/enable ]; then
source /opt/rh/devtoolset-7/enable
fi
EOT
- command: expansions.update
params:
file: expansions.yml
post:
# attach.results works for jstests, gotest.parse_files for golang tests
- command: attach.results
params:
file_location: src/github.com/mongodb/mongo-tools/report.json
- command: gotest.parse_files
params:
files: ["src/github.com/mongodb/mongo-tools/testing_output/*.suite"]
- command: shell.exec
params:
silent: true
script: |
set -x
set -v
${killall_mci|pkill -9 mongo; pkill -9 mongodump; pkill -9 mongoexport; pkill -9 mongoimport; pkill -9 mongofiles; pkill -9 mongorestore; pkill -9 mongostat; pkill -9 mongotop; pkill -9 mongod; pkill -9 mongos; pkill -f buildlogger.py; pkill -f smoke.py} >/dev/null 2>&1
exit 0
- command: shell.exec
params:
script: |
set -x
set -v
rm -rf /data/db/*
exit 0
timeout:
- command: shell.exec
params:
silent: true
script: |
set -x
set -v
# don't attempt to abort on any distro which has a special way of
# killing everything (i.e. using taskkill on Windows)
if [ "${killall_mci}" = "" ]; then
all_tools="bsondump mongodump mongoexport mongofiles mongoimport mongorestore mongostat mongotop"
# send SIGABRT to print a stacktrace for any hung tool
pkill -ABRT "^($(echo -n $all_tools | tr ' ' '|'))\$"
# git the processes a second or two to dump their stacks
sleep 10
fi
tasks:
- name: dist
tags: ["git_tag"]
depends_on:
commands:
- func: "fetch source"
- func: "run make target"
vars:
target: checkMinVersion
- func: "run make target"
vars:
target: build
- func: "create release artifacts"
# Regardless of the buildvariant, the sign task must be run on a
# distro that has the notary client available. We will use
# amazon1-2018-test for this purpose. The notary client is not
# available on all distros, which is why sign must be a separate task.
- name: sign
tags: ["git_tag"]
depends_on:
- name: dist
commands:
- func: "fetch source"
- func: "fetch dist release artifacts"
- func: "sign artifacts"
- func: "upload signed release artifacts"
- name: push
tags: ["git_tag"]
depends_on:
- name: sign
commands:
- func: "fetch source"
- command: expansions.update
- func: "upload release packages to s3"
- func: "upload release packages to linux repos"
- command: subprocess.exec
params:
binary: bash
working_dir: src/github.com/mongodb/mongo-tools
args:
- "./scripts/set-expansions-for-papertrail.sh"
- command: expansions.update
params:
file: src/github.com/mongodb/mongo-tools/expansions.yml
- func: "fetch dist release artifacts"
- command: papertrail.trace
params:
key_id: ${papertrail_key_id}
secret_key: ${papertrail_secret_key}
product: ${product_name}
version: ${release_tag}
filenames:
- "./src/github.com/mongodb/mongo-tools/mongodb-database-tools*"
- name: gosec-SARIF-report
tags: ["git_tag"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "run make target"
vars:
target: sa:installdevtools
- func: "generate gosec SARIF report"
- name: check-snyk-results
tags: ["git_tag"]
commands:
- func: "fetch source"
- command: expansions.update
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
set -e
curl -sSL -o ./snyk https://static.snyk.io/cli/latest/snyk-linux
chmod 0755 ./snyk
./snyk test --org="${snyk_organization_id}" --file=./go.mod
- name: check-augmented-sbom
tags: ["git_tag"]
commands:
- func: "fetch source"
- command: expansions.update
- command: shell.exec
params:
working_dir: src/github.com/mongodb/mongo-tools
script: |
${_set_shell_env}
./scripts/regenerate-and-diff-augmented-sbom.sh
- name: release-json
tags: ["git_tag"]
depends_on:
- name: check-snyk-results
variant: "*"
- name: push
variant: "*"
commands:
- func: "fetch source"
- command: expansions.update
- func: "upload release json feed to s3"
- name: generate-full-json
depends_on:
- name: check-snyk-results
variant: "*"
commands:
- func: "fetch source"
- command: expansions.update
- func: "generate full JSON feed"
- name: integration-3.6
tags: ["3.6"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "3.6"
- func: "start mongod"
- func: "wait for mongod to be ready"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true ${testArgs}
- name: integration-3.6-mmapv1
tags: ["3.6", "mmap"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "3.6"
- func: "start mongod"
vars:
STORAGE_ENGINE: "mmapv1"
- func: "wait for mongod to be ready"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true ${testArgs}
- name: integration-4.0
tags: ["4.0"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "4.0"
- func: "start mongod"
- func: "wait for mongod to be ready"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true ${testArgs}
- name: integration-4.0-auth
tags: ["4.0", "auth"]
commands:
- func: "fetch source"
# Concat auth args
- command: expansions.update
params:
updates:
- key: "mongod_args"
concat: " --auth"
- func: "download mongod and shell"
vars:
mongo_version: "4.0"
- func: "start mongod"
- func: "wait for mongod to be ready"
- func: "create mongod users"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true -auth=true ${testArgs}
- name: integration-4.0-cluster
tags: ["4.0", "cluster"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "4.0"
- func: "create repl_set"
vars:
USE_SSL: "true"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true ${testArgs}
- name: integration-4.0-mmapv1
tags: ["4.0", "mmap"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "4.0"
- func: "start mongod"
vars:
STORAGE_ENGINE: "mmapv1"
- func: "wait for mongod to be ready"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true ${testArgs}
- name: integration-4.2
tags: ["4.2"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "4.2"
- func: "start mongod"
vars:
USE_TLS: "true"
- func: "wait for mongod to be ready"
vars:
USE_TLS: "true"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true ${testArgs}
- name: integration-4.2-auth
tags: ["4.2", "auth"]
commands:
- func: "fetch source"
# Concat auth args
- command: expansions.update
params:
updates:
- key: "mongod_args"
concat: " --auth"
- func: "download mongod and shell"
vars:
mongo_version: "4.2"
- func: "start mongod"
vars:
USE_TLS: "true"
- func: "wait for mongod to be ready"
vars:
USE_TLS: "true"
- func: "create mongod users"
vars:
USE_TLS: "true"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true -auth=true ${testArgs}
- name: integration-4.4
tags: ["4.4"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "4.4"
- func: "start mongod"
vars:
USE_TLS: "true"
- func: "wait for mongod to be ready"
vars:
USE_TLS: "true"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true ${testArgs}
- name: integration-4.4-auth
tags: ["4.4", "auth"]
commands:
- func: "fetch source"
# Concat auth args
- command: expansions.update
params:
updates:
- key: "mongod_args_tls"
concat: " --auth"
- func: "download mongod and shell"
vars:
mongo_version: "4.4"
- func: "start mongod"
vars:
USE_TLS: "true"
- func: "wait for mongod to be ready"
vars:
USE_TLS: "true"
- func: "create mongod users"
vars:
USE_TLS: "true"
- func: "run make target"
vars:
target: build
- func: "run make target"
vars:
target: test:integration -ssl=true -auth=true ${testArgs}
- name: integration-4.4-cluster
tags: ["4.4", "cluster"]
commands:
- func: "fetch source"
- command: expansions.update
- func: "download mongod and shell"
vars:
mongo_version: "4.4"
- func: "create repl_set"
vars:
USE_TLS: "true"
- func: "run make target"