Skip to content

Commit 0092996

Browse files
authored
chore(hadron-build): use macos notarization service COMPASS-5477 (#2796)
1 parent 6b9860e commit 0092996

File tree

13 files changed

+824
-522
lines changed

13 files changed

+824
-522
lines changed

.evergreen.yml

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ variables:
2323
content_type: application/octet-stream
2424
- &compass-env
2525
# NOTE: anything added here should probably also be added to the list
26-
# in .evergreen/export-compass-env.js
2726
WORKDIR: ${workdir}
2827
CI: '1'
2928
EVERGREEN: '1'
@@ -60,7 +59,10 @@ variables:
6059
NOTARY_AUTH_TOKEN: ${signing_auth_token}
6160
NOTARY_SIGNING_KEY: ${signing_key_name}
6261
NOTARY_SIGNING_COMMENT: Evergreen project mongodb/compass ${revision} - ${build_variant} - ${branch_name}
63-
APPLE_CREDENTIALS: '{\"appleUsername\": \"${apple_username}\", \"applePassword\": \"${apple_password}\"}'
62+
MACOS_NOTARY_KEY: ${macos_notary_key}
63+
MACOS_NOTARY_SECRET: ${macos_notary_secret}
64+
MACOS_NOTARY_CLIENT_URL: 'https://macos-notary-1628249594.s3.amazonaws.com/releases/client/v3.1.0/darwin_amd64.zip'
65+
MACOS_NOTARY_API_URL: 'https://dev.macos-notary.build.10gen.cc/api'
6466
GITHUB_TOKEN: ${devtoolsbot_github_token}
6567
DOWNLOAD_CENTER_AWS_ACCESS_KEY_ID: ${aws_key_evergreen_integrations}
6668
DOWNLOAD_CENTER_AWS_SECRET_ACCESS_KEY: ${aws_secret_evergreen_integrations}
@@ -191,7 +193,7 @@ functions:
191193
# debug option is not very useful in normal runs, but helpful when
192194
# debugging any issues with tests. Set to "mocha*", "hadron*", or
193195
# "mongo*" for some helpful output from the test tooling we are using
194-
#
196+
#
195197
# compass-e2e-tests are ignored as we are running this test suite
196198
# separately in the test-packaged-app task
197199
DEBUG=${debug} MONGODB_VERSION=${mongodb_version|4} npm run --unsafe-perm test-ci -- --stream --ignore compass-e2e-tests
@@ -227,26 +229,14 @@ functions:
227229
shell: bash
228230
env:
229231
<<: *compass-env
230-
# NOTE: anything added here should also be added to export-compass-env.js
231232
DEBUG: ${debug}
232233
npm_config_loglevel: ${npm_loglevel}
233234
COMPASS_DISTRIBUTION: ${compass_distribution}
234235
script: |
235236
set -e
236237
237238
eval $(.evergreen/print-compass-env.sh)
238-
239-
if [ `uname` == Darwin ]; then
240-
# write env vars (including secrets) to a script so we can restore them after running ssh
241-
.evergreen/export-compass-env.js >> env-vars.sh
242-
243-
echo "Signing via ssh tunnel..."
244-
ssh -v -p 2222 localhost "cd ${workdir}/src/; .evergreen/package_mac.sh"
245-
246-
rm env-vars.sh
247-
else
248-
.evergreen/package_notmac.sh
249-
fi
239+
.evergreen/compass_package.sh
250240
251241
publish:
252242
- command: shell.exec
@@ -460,7 +450,7 @@ tasks:
460450
- func: save-macos-artifacts
461451
vars:
462452
compass_distribution: compass
463-
variants: [macos]
453+
variants: [macos_package]
464454
- func: save-rhel-artifacts
465455
vars:
466456
compass_distribution: compass
@@ -492,7 +482,7 @@ tasks:
492482
- func: save-macos-artifacts
493483
vars:
494484
compass_distribution: compass-isolated
495-
variants: [macos]
485+
variants: [macos_package]
496486
- func: save-rhel-artifacts
497487
vars:
498488
compass_distribution: compass-isolated
@@ -524,7 +514,7 @@ tasks:
524514
- func: save-macos-artifacts
525515
vars:
526516
compass_distribution: compass-readonly
527-
variants: [macos]
517+
variants: [macos_package]
528518
- func: save-rhel-artifacts
529519
vars:
530520
compass_distribution: compass-readonly
@@ -534,6 +524,7 @@ tasks:
534524
compass_distribution: compass-readonly
535525
variants: [ubuntu]
536526

527+
# copied as test-packaged-app-macos due to depends_on variation
537528
- name: test-packaged-app
538529
tags: ['required-for-publish']
539530
depends_on:
@@ -555,6 +546,29 @@ tasks:
555546
compass_distribution: compass
556547
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
557548

549+
# same as test-packaged-app except for depends_on
550+
- name: test-packaged-app-macos
551+
tags: ['required-for-publish']
552+
depends_on:
553+
- name: package
554+
variant: macos_package
555+
commands:
556+
- func: prepare
557+
- func: install
558+
- func: bootstrap
559+
vars:
560+
scope: 'compass-e2e-tests'
561+
- func: apply-compass-target-expansion
562+
vars:
563+
compass_distribution: compass
564+
- func: get-packaged-app
565+
vars:
566+
compass_distribution: compass
567+
- func: test-packaged-app
568+
vars:
569+
compass_distribution: compass
570+
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
571+
558572
# Publish happens in one go to make sure we are not creating multiple github
559573
# releases in parallel
560574
- name: publish
@@ -663,10 +677,16 @@ buildvariants:
663677
tasks:
664678
- name: test
665679
- name: check
680+
- name: test-packaged-app-macos
681+
682+
- name: macos_package
683+
display_name: MacOS (Packaging)
684+
# TODO: Change this to our pool of machines when https://jira.mongodb.org/browse/BUILD-14120 is done
685+
run_on: macos-1014
686+
tasks:
666687
- name: package
667688
- name: package-readonly
668689
- name: package-isolated
669-
- name: test-packaged-app
670690

671691
- name: windows
672692
display_name: Windows

.evergreen/compass_package.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
#! /usr/bin/env bash
2+
if [[ "$OSTYPE" == "cygwin" ]]; then
3+
# If not possible to remove this hack, we should find a better way
4+
# to do this instead of directly referencing node_module paths,
5+
# but first figure out what exactly was changed in our fork of
6+
# electron-wix-msi
7+
#
8+
# TODO: https://jira.mongodb.org/browse/COMPASS-4888
9+
10+
echo "Fetching signtool -> notary-service hack..."
11+
curl -fs \
12+
-o "signtool.exe" \
13+
--url "https://s3.amazonaws.com/boxes.10gen.com/build/signtool.exe"
14+
rm -f node_modules/electron-winstaller/vendor/signtool.exe
15+
rm -f node_modules/@mongodb-js/electron-wix-msi/vendor/signtool.exe
16+
chmod +x signtool.exe
17+
cp signtool.exe node_modules/@mongodb-js/electron-wix-msi/vendor/signtool.exe
18+
cp signtool.exe node_modules/electron-winstaller/vendor/signtool.exe
19+
20+
echo "Starting Installer Service..."
21+
net start MSIServer
22+
fi
223

324
echo "Creating signed release build..."
425
npm run package-compass $COMPASS_DISTRIBUTION;
526

6-
ls -la packages/compass/dist
27+
ls -la packages/compass/dist

.evergreen/export-compass-env.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

.evergreen/package_mac.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

.evergreen/package_notmac.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)