@@ -64,10 +64,6 @@ variables:
6464 E2E_TESTS_ATLAS_READANYDATABASE_STRING : ${e2e_tests_atlas_readanydatabase_string}
6565 E2E_TESTS_ATLAS_CUSTOMROLE_STRING : ${e2e_tests_atlas_customrole_string}
6666 E2E_TESTS_ATLAS_SPECIFICPERMISSION_STRING : ${e2e_tests_atlas_specificpermission_string}
67- NOTARY_URL : http://notary-service.build.10gen.cc:5000
68- NOTARY_AUTH_TOKEN : ${signing_auth_token}
69- NOTARY_SIGNING_KEY : ${signing_key_name}
70- NOTARY_SIGNING_COMMENT : Evergreen project mongodb/compass ${revision} - ${build_variant} - ${branch_name}
7167 MACOS_NOTARY_KEY : ${macos_notary_key}
7268 MACOS_NOTARY_SECRET : ${macos_notary_secret}
7369 MACOS_NOTARY_CLIENT_URL : ' https://macos-notary-1628249594.s3.amazonaws.com/releases/client/latest/darwin_amd64.zip'
@@ -80,6 +76,10 @@ variables:
8076 MONGODB_RUNNER_LOG_DIR : ${workdir}/src/.testserver/
8177 E2E_TESTS_ATLAS_CS_WITHOUT_SEARCH : ${e2e_tests_atlas_cs_without_search}
8278 E2E_TESTS_ATLAS_CS_WITH_SEARCH : ${e2e_tests_atlas_cs_with_search}
79+ GARASIGN_USERNAME : ${garasign_username}
80+ GARASIGN_PASSWORD : ${garasign_password}
81+ ARTIFACTORY_USERNAME : ${artifactory_username}
82+ ARTIFACTORY_PASSWORD : ${artifactory_password}
8383
8484# This is here with the variables because anchors aren't supported across includes
8585post :
@@ -306,6 +306,85 @@ functions:
306306 # and be able to find the binary that is used for the tests
307307 file : src/packages/compass/expansions.yml
308308
309+ spawn-signing-server :
310+ # spawn
311+ - command : host.create
312+ type : setup
313+ params :
314+ provider : ec2
315+ distro : ubuntu2004-large
316+ security_group_ids :
317+ - sg-097bff6dd0d1d31d0 # Magic string that's needed for SSH'ing.
318+ # write host info (this file will be read by signingtool when connection to ssh server)
319+ - command : host.list
320+ params :
321+ num_hosts : 1
322+ path : spawned_hosts.json
323+ timeout_seconds : 1200
324+ wait : true
325+ # copy ssh key (this key will be used to connect to ssh server)
326+ - command : shell.exec
327+ params :
328+ shell : bash
329+ script : |
330+ set -e
331+ {
332+ set +x
333+ echo '${__project_aws_ssh_key_value}' > ~/.ssh/mcipacker.pem
334+ chmod 0600 ~/.ssh/mcipacker.pem
335+ set -x
336+ }
337+ # wait for host to be ready
338+ - command : shell.exec
339+ params :
340+ exec_as_string : true
341+ shell : bash
342+ script : |
343+ set -e
344+ user=ubuntu
345+ hostname=$(tr -d '"[]{}' < spawned_hosts.json | cut -d , -f 1 | awk -F : '{print $2}')
346+ identity_file=$(echo ~/.ssh/mcipacker.pem)
347+
348+ attempts=0
349+ connection_attempts=25
350+
351+ ## Check for remote connectivity
352+ while ! ssh \
353+ -i "$identity_file" \
354+ -o ConnectTimeout=10 \
355+ -o ForwardAgent=yes \
356+ -o IdentitiesOnly=yes \
357+ -o StrictHostKeyChecking=no \
358+ "$(printf "%s@%s" "$user" "$hostname")" \
359+ exit
360+ do
361+ if [ "$attempts" -ge "$connection_attempts" ]; then
362+ echo "SSH connection failed after $connection_attempts attempts. Exiting..."
363+ exit 1
364+ fi
365+ printf "SSH connection attempt %d/%d failed. Retrying...\n" "$((attempts++))" "$connection_attempts"
366+ ## sleep for Permission denied (publickey) errors
367+ sleep 20
368+ done
369+ echo "SSH connection established after $attempts attempts"
370+
371+ # Write the host info so that it can be used by the signing tool
372+ if [[ $OSTYPE == "cygwin" ]]; then
373+ identity_file=$(cygpath -wa "$identity_file")
374+ else
375+ identity_file=$(eval echo "$identity_file")
376+ fi
377+ cat <<EOL > signing_host_info.yml
378+ SIGNING_SERVER_HOSTNAME : $hostname
379+ SIGNING_SERVER_PRIVATE_KEY : $identity_file
380+ SIGNING_SERVER_USERNAME : $user
381+ SIGNING_SERVER_PORT : 22
382+ EOL
383+ # Update the expansions
384+ - command : expansions.update
385+ params :
386+ file : signing_host_info.yml
387+
309388 package :
310389 - command : shell.exec
311390 params :
@@ -316,6 +395,10 @@ functions:
316395 DEBUG : ${debug}
317396 npm_config_loglevel : ${npm_loglevel}
318397 COMPASS_DISTRIBUTION : ${compass_distribution}
398+ SIGNING_SERVER_HOSTNAME : ${SIGNING_SERVER_HOSTNAME}
399+ SIGNING_SERVER_PRIVATE_KEY : ${SIGNING_SERVER_PRIVATE_KEY}
400+ SIGNING_SERVER_USERNAME : ${SIGNING_SERVER_USERNAME}
401+ SIGNING_SERVER_PORT : ${SIGNING_SERVER_PORT}
319402 script : |
320403 set -e
321404
@@ -504,12 +587,26 @@ functions:
504587 remote_file : ${project}/${revision}_${revision_order_id}/${windows_zip_filename}
505588 content_type : application/zip
506589 optional : true
590+ - command : s3.put
591+ params :
592+ << : *save-artifact-params-public
593+ local_file : src/packages/compass/dist/${windows_zip_sign_filename}
594+ remote_file : ${project}/${revision}_${revision_order_id}/${windows_zip_sign_filename}
595+ content_type : application/pgp-signature
596+ optional : true
507597 - command : s3.put
508598 params :
509599 << : *save-artifact-params-public
510600 local_file : src/packages/compass/dist/${windows_nupkg_full_filename}
511601 remote_file : ${project}/${revision}_${revision_order_id}/${windows_nupkg_full_filename}
512602 optional : true
603+ - command : s3.put
604+ params :
605+ << : *save-artifact-params-public
606+ local_file : src/packages/compass/dist/${windows_nupkg_full_sign_filename}
607+ remote_file : ${project}/${revision}_${revision_order_id}/${windows_nupkg_full_sign_filename}
608+ content_type : application/pgp-signature
609+ optional : true
513610 - command : s3.put
514611 params :
515612 << : *save-artifact-params-public
@@ -530,34 +627,69 @@ functions:
530627 remote_file : ${project}/${revision}_${revision_order_id}/${osx_zip_filename}
531628 content_type : application/zip
532629 optional : true
630+ - command : s3.put
631+ params :
632+ << : *save-artifact-params-public
633+ local_file : src/packages/compass/dist/${osx_zip_sign_filename}
634+ remote_file : ${project}/${revision}_${revision_order_id}/${osx_zip_sign_filename}
635+ content_type : application/pgp-signature
636+ optional : true
533637 - command : s3.put
534638 params :
535639 << : *save-artifact-params-public
536640 local_file : src/packages/compass/dist/${linux_rpm_filename}
537641 remote_file : ${project}/${revision}_${revision_order_id}/${linux_rpm_filename}
538642 content_type : application/x-redhat-package-manager
539643 optional : true
644+ - command : s3.put
645+ params :
646+ << : *save-artifact-params-public
647+ local_file : src/packages/compass/dist/${linux_rpm_sign_filename}
648+ remote_file : ${project}/${revision}_${revision_order_id}/${linux_rpm_sign_filename}
649+ content_type : application/pgp-signature
650+ optional : true
540651 - command : s3.put
541652 params :
542653 << : *save-artifact-params-public
543654 local_file : src/packages/compass/dist/${rhel_tar_filename}
544655 remote_file : ${project}/${revision}_${revision_order_id}/${rhel_tar_filename}
545656 content_type : application/x-gzip
546657 optional : true
658+ - command : s3.put
659+ params :
660+ << : *save-artifact-params-public
661+ local_file : src/packages/compass/dist/${rhel_tar_sign_filename}
662+ remote_file : ${project}/${revision}_${revision_order_id}/${rhel_tar_sign_filename}
663+ content_type : application/pgp-signature
664+ optional : true
547665 - command : s3.put
548666 params :
549667 << : *save-artifact-params-public
550668 local_file : src/packages/compass/dist/${linux_deb_filename}
551669 remote_file : ${project}/${revision}_${revision_order_id}/${linux_deb_filename}
552670 content_type : application/vnd.debian.binary-package
553671 optional : true
672+ - command : s3.put
673+ params :
674+ << : *save-artifact-params-public
675+ local_file : src/packages/compass/dist/${linux_deb_sign_filename}
676+ remote_file : ${project}/${revision}_${revision_order_id}/${linux_deb_sign_filename}
677+ content_type : application/pgp-signature
678+ optional : true
554679 - command : s3.put
555680 params :
556681 << : *save-artifact-params-public
557682 local_file : src/packages/compass/dist/${linux_tar_filename}
558683 remote_file : ${project}/${revision}_${revision_order_id}/${linux_tar_filename}
559684 content_type : application/x-gzip
560685 optional : true
686+ - command : s3.put
687+ params :
688+ << : *save-artifact-params-public
689+ local_file : src/packages/compass/dist/${linux_tar_sign_filename}
690+ remote_file : ${project}/${revision}_${revision_order_id}/${linux_tar_sign_filename}
691+ content_type : application/pgp-signature
692+ optional : true
561693
562694 get-all-artifacts :
563695 - command : shell.exec
0 commit comments