forked from mongodb-js/compass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.evergreen.yml
690 lines (632 loc) · 20.3 KB
/
.evergreen.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
stepback: false
exec_timeout_secs: 3600
## Variables
variables:
- &save-artifact
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
bucket: mciuploads
permissions: public-read
content_type: application/octet-stream
post:
- &save-diagnostic-file
<<: *save-artifact
params:
local_files_include_filter:
- src/.deps/.npm/_logs/*.log
remote_file: ${project}/${revision}/${build_variant}/${task_name}
content_type: text/plain
- <<: *save-diagnostic-file
params:
local_files_include_filter:
- ~/.mongodb/runner/*.log
functions:
'prepare':
- command: git.get_project
params:
directory: src
- &generate-compass-env
command: shell.exec
params:
working_dir: src
shell: bash
script: |
echo "Setting up ~/compass_env.sh"
cat <<EOF_BUILD_SH > ~/compass_env.sh
export CI=1
export EVERGREEN=1
# Make default evergreen expansions accessible to hadron-build
export EVERGREEN_ASSET_PREFIX="s3://mciuploads/${project}/${revision}";
export EVERGREEN_AUTHOR="${author}";
export EVERGREEN_AWS_ACCESS_KEY_ID="${aws_key}";
export EVERGREEN_AWS_SECRET_ACCESS_KEY="${aws_secret}";
export EVERGREEN_BRANCH_NAME="${branch_name}";
export EVERGREEN_BUILD_ID="${build_id}";
export EVERGREEN_BUILD_VARIANT="${build_variant}";
export EVERGREEN_EXECUTION="${execution}";
export EVERGREEN_IS_PATCH=${is_patch};
export EVERGREEN_PROJECT="${project}";
export EVERGREEN_REVISION="${revision}";
export EVERGREEN_TASK_ID="${task_id}";
export EVERGREEN_TASK_NAME="${task_name}";
export EVERGREEN_TASK_URL="https://evergreen.mongodb.com/task/${task_id}";
export EVERGREEN_VERSION_ID="${version_id}";
export EVERGREEN_WORKDIR="${workdir}";
export HADRON_METRICS_BUGSNAG_KEY="${metrics_bugsnag_key}";
export HADRON_METRICS_INTERCOM_APP_ID="${metrics_intercom_app_id}";
export HADRON_METRICS_STITCH_APP_ID="${metrics_stitch_app_id}";
# node stuff
export ARTIFACTS_PATH="$(pwd)/.deps"
export NPM_CACHE_DIR="$(pwd)/.deps/.npm"
export NPM_TMP_DIR="$(pwd)/.deps/tmp"
export NPM_AUTH_TOKEN="${compass_npm_token}"
export NODE_JS_VERSION="12.4.0"
# TODO: lucas: Go back to npm@latest after 6.13.4 released
# or https://jira.mongodb.org/browse/COMPASS-4019 removes jade.
# https://jira.mongodb.org/browse/COMPASS-4018
# export NPM_VERSION="latest"
export NPM_VERSION="6.13.2"
if [[ "$OSTYPE" == "cygwin" ]]; then
# NOTE lucas: for git-core addition, See
# https://jira.mongodb.org/browse/COMPASS-4122
export PATH="/cygdrive/c/Program Files/Git/mingw32/libexec/git-core/:$(pwd)/.deps:/cygdrive/c/wixtools/bin/:$PATH"
export APPDATA=Z:\\\;
fi
if [[ "$OSTYPE" != "cygwin" ]]; then
export PATH="$(pwd)/.deps/bin:$PATH"
fi
EOF_BUILD_SH
source ~/compass_env.sh
# Make all the dirs
mkdir -p $ARTIFACTS_PATH
mkdir -p $NPM_CACHE_DIR
mkdir -p $NPM_TMP_DIR
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
source ~/compass_env.sh
echo "Configuring npm..."
cat <<EOT >> .npmrc
devdir=$NPM_CACHE_DIR/.node-gyp
init-module=$NPM_CACHE_DIR/.npm-init.js
cache=$NPM_CACHE_DIR
tmp=$NPM_TMP_DIR
_authToken=$NPM_AUTH_TOKEN
EOT
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
source ~/compass_env.sh
bash .evergreen/preinstall.sh
install:
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
source ~/compass_env.sh
echo "Installing Compass dependencies..."
echo "If npm ci fails, debug.log will be uploaded to S3."
npm ci --unsafe-perm
save:
- command: shell.exec
params:
shell: bash
script: |
set -e
tar -zcf compass-build.tgz ./src
- <<: *save-artifact
params:
local_file: compass-build.tgz
remote_file: ${project}/${revision}/${build_variant}/build.tgz
restore:
- &restore-fetch-s3
command: s3.get
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: compass-build.tgz
remote_file: ${project}/${revision}/${build_variant}/build.tgz
bucket: mciuploads
content_type: application/octet-stream
- &restore-unpack-s3
command: shell.exec
shell: bash
params:
script: |
set -e
tar xzf compass-build.tgz --strip-components=1
# TODO: lucas: may want to remove ./node_modules here before running npm ci like travis does?
ls -alh
- <<: *generate-compass-env
verify:
command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
source ~/compass_env.sh
echo "Run static analysis..."
npm run check;
test:
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
# Load environment variables
source ~/compass_env.sh
echo "Running tests for compass suite ${test_suite}..."
bash .evergreen/pretest.sh
# NOTE (@imlucas) Starting with MongoDB 4.0.4, the Server binaries
# have dropped support for macOS 10.10 because it is now outside
# of the supported version range.
# https://docs.google.com/document/d/1IfQGC7wTtrlsc2SqURirvt_4uMuU606nXNbu-stw6bQ/edit
DEBUG=* MONGODB_VERSION=${mongodb_version|4.0.3} npm test -- --${test_suite}
# - command: attach.results
# params:
# file_location: src/test-results.xml
test-plugin:
- <<: *restore-fetch-s3
- <<: *restore-unpack-s3
- <<: *generate-compass-env
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
source ~/compass_env.sh
export ELECTRON_NO_ATTACH_CONSOLE=1
export ELECTRON_ENABLE_LOGGING=1
bash ./.evergreen/test-plugin.sh ${plugin|10gen/compass-connect}
# - command: attach.xunit_results
# params:
# file: src/plugin/plugin-test-results.xml
'package':
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
# Load environment variables generated by `prepare`
source ~/compass_env.sh
echo "Synchronizing evergreen environment from Compass build tools..."
npm run evergreen-expansions ${compass_distribution}
- command: expansions.update
params:
file: src/expansions.yml
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
source ~/compass_env.sh
cat <<EOF_BUILD_SH > ~/compass_package.sh
#! /usr/bin/env bash
cd $(pwd)
# Load environment variables
source ~/compass_env.sh
# For debugging any problems when the notary service fails.
# @see https://github.com/mongodb-js/notary-service-client For details on what notary service is.
export DEBUG=mongodb-notary*
# Required to sign release assets
export NOTARY_URL="http://notary-service.build.10gen.cc:5000"
export NOTARY_AUTH_TOKEN="${signing_auth_token}"
export NOTARY_SIGNING_KEY="${signing_key_name}"
export NOTARY_SIGNING_COMMENT="Evergreen project mongodb/compass ${revision} - ${build_variant} - ${branch_name}"
if [ `uname` == Darwin ]; then
# We do print the environment during the build process in a few places
# but we probably should stop doing that. After that, we can go back
# to using plain APPLE_USERNAME and APPLE_PASSWORD environment variables.
echo '{"appleUsername": "${apple_username}", "applePassword": "${apple_password}"}' > /tmp/compass-apple-cred.json
export APPLE_CREDENTIALS_FILE="/tmp/compass-apple-cred.json"
fi
echo "Creating signed release build..."
if [[ "$OSTYPE" == "cygwin" ]]; then
echo "Starting Installer Service..."
net start MSIServer
fi
export NPM_CONFIG_LOGLEVEL=info
export DEBUG="*,-flora-colossus"
npm run release-evergreen ${compass_distribution};
rm -f /tmp/compass-apple-cred.json
EOF_BUILD_SH
if [ `uname` == Darwin ]; then
echo "Signing via ssh tunnel..."
ssh -v -p 2222 localhost "bash ~/compass_package.sh"
else
if [[ "$OSTYPE" == "cygwin" ]]; then
echo "Fetching signtool -> notary-service hack..."
curl -fs \
-o "signtool.exe" \
--url "https://s3.amazonaws.com/boxes.10gen.com/build/signtool.exe"
rm -f node_modules/electron-winstaller/vendor/signtool.exe
rm -f node_modules/@mongodb-js/electron-wix-msi/vendor/signtool.exe
chmod +x signtool.exe
cp signtool.exe node_modules/@mongodb-js/electron-wix-msi/vendor/signtool.exe
fi
bash ~/compass_package.sh
ls -la dist
fi
'publish':
command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
# Load environment variables
source ~/compass_env.sh
# Required to upload release assets to GitHub
export GITHUB_TOKEN=${leafybot_github_token}
# Required to upload release assets to s3 for download center
export DOWNLOAD_CENTER_AWS_ACCESS_KEY_ID=${aws_key_evergreen_integrations}
export DOWNLOAD_CENTER_AWS_SECRET_ACCESS_KEY=${aws_secret_evergreen_integrations}
echo "Uploading release assets to S3 and GitHub if needed..."
npm run upload ${compass_distribution}
'save windows artifacts':
# setup
- <<: *save-artifact
params:
local_file: src/dist/${windows_setup_filename}
remote_file: ${project}/${revision}/${windows_setup_filename}
# MSI
- <<: *save-artifact
params:
local_file: src/dist/${windows_msi_filename}
remote_file: ${project}/${revision}/${windows_msi_filename}
# ZIP
- <<: *save-artifact
params:
local_file: src/dist/${windows_zip_filename}
remote_file: ${project}/${revision}/${windows_zip_filename}
content_type: application/zip
# RELEASES file
- <<: *save-artifact
params:
local_file: src/dist/RELEASES
remote_file: ${project}/${revision}/${compass_distribution}-RELEASES
# nupkg full
- <<: *save-artifact
params:
local_file: src/dist/${windows_nupkg_full_filename}
remote_file: ${project}/${revision}/${windows_nupkg_full_filename}
'save osx artifacts':
# .dmg
- <<: *save-artifact
params:
local_file: src/dist/${osx_dmg_filename}
remote_file: ${project}/${revision}/${osx_dmg_filename}
content_type: 'application/x-apple-diskimage'
# .zip
- <<: *save-artifact
params:
local_file: src/dist/${osx_zip_filename}
remote_file: ${project}/${revision}/${osx_zip_filename}
content_type: application/zip
'save linux artifacts':
# .deb
- <<: *save-artifact
params:
local_file: src/dist/${linux_deb_filename}
remote_file: ${project}/${revision}/${linux_deb_filename}
content_type: 'application/vnd.debian.binary-package'
# .tar.gz
- <<: *save-artifact
params:
local_file: src/dist/${linux_tar_filename}
remote_file: ${project}/${revision}/${linux_tar_filename}
content_type: application/x-gzip
'save rhel artifacts':
# .rpm
- <<: *save-artifact
params:
local_file: src/dist/${linux_rpm_filename}
remote_file: ${project}/${revision}/${linux_rpm_filename}
content_type: application/x-redhat-package-manager
# .tar.gz
- <<: *save-artifact
params:
local_file: src/dist/${linux_tar_filename}
remote_file: ${project}/${revision}/${linux_tar_filename}
content_type: application/x-gzip
# Tasks
tasks:
- name: oneshot-compile-test-package-publish
commands:
- func: prepare
- func: install
# - func: test
# vars:
# test_suite: functional
- func: package
vars:
compass_distribution: compass
- func: publish
vars:
compass_distribution: compass
- func: 'save osx artifacts'
- func: package
vars:
compass_distribution: compass-isolated
- func: publish
vars:
compass_distribution: compass-isolated
- func: 'save osx artifacts'
- func: package
vars:
compass_distribution: compass-readonly
- func: publish
vars:
compass_distribution: compass-readonly
- func: 'save osx artifacts'
- name: compile
depends_on: []
commands:
- func: prepare
- func: install
- func: save
- name: verify
depends_on: [compile]
tags:
- 'verify'
commands:
- func: restore
- func: verify
- name: test-unit
depends_on: [compile]
tags:
- test
commands:
- func: restore
- func: test
vars:
test_suite: unit
- name: test-functional
depends_on: [compile]
tags:
- 'test'
commands:
- func: restore
- func: test
vars:
test_suite: functional
- name: test-hadron-spectron
depends_on: [compile]
commands:
- func: test-plugin
vars: { plugin: mongodb-js/hadron-spectron }
- name: test-data-service
depends_on: [compile]
commands:
- func: test-plugin
vars: { plugin: mongodb-js/data-service }
- name: test-connect-plugin
depends_on: [compile]
commands:
- func: test-plugin
vars: { plugin: 10gen/compass-connect }
- name: test-aggregation-builder-plugin
depends_on: [compile]
commands:
- func: test-plugin
vars: { plugin: mongodb-js/compass-aggregations }
- name: package-and-publish-compass
depends_on: [compile]
commands:
- func: restore
- func: package
vars:
compass_distribution: compass
- func: publish
vars:
compass_distribution: compass
- func: 'save windows artifacts'
variants: [windows]
# NOTE (@imlucas) Because macos can't utilize task parallelism
# and instead runs `oneshot-compile-test-package-publish`
# save osx artifacts doesn't apply here until we have more than
# 1 macos box setup to run functional tests.
# - func: 'save osx artifacts'
# variants: [macos]
- func: 'save linux artifacts'
variants: [ubuntu]
- func: 'save rhel artifacts'
variants: [rhel]
- name: package-and-publish-compass-isolated
depends_on: [compile]
commands:
- func: restore
- func: package
vars:
compass_distribution: compass-isolated
- func: publish
vars:
compass_distribution: compass-isolated
- func: 'save windows artifacts'
variants: [windows]
- func: 'save linux artifacts'
variants: [ubuntu]
- func: 'save rhel artifacts'
variants: [rhel]
- name: package-and-publish-compass-readonly
depends_on: [compile]
commands:
- func: restore
- func: package
vars:
compass_distribution: compass-readonly
- func: publish
vars:
compass_distribution: compass-readonly
- func: 'save windows artifacts'
variants: [windows]
- func: 'save linux artifacts'
variants: [ubuntu]
- func: 'save rhel artifacts'
variants: [rhel]
# NOTE (@imlucas) Examples of how to extend which tests run
# and against which MongoDB Server version.
#
# - name: test-renderer
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: renderer
# - name: test-main
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: main
# - name: test-enzyme
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: enzyme
# - name: test-unit
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: unit
# mongodb_version: stable
# - name: test-functional-unstable-server
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: functional
# mongodb_version: stable
# - name: test-functional-unstable-server
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: functional
# mongodb_version: unstable
# - name: test-functional-36x-server
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: functional
# mongodb_version: 3.6.x
# - name: test-functional-34x-server
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: functional
# mongodb_version: 3.4.x
# - name: test-functional-26x-server
# depends_on: [compile]
# tags:
# - 'test'
# commands:
# - func: restore
# - func: test
# vars:
# test_suite: functional
# mongodb_version: 2.6.x
# TODO (@imlucas) determine OS/version deprecation policy, following server, so we don't fall behind
# what maximal resources we're using.
# See https://docs.google.com/document/d/1IfQGC7wTtrlsc2SqURirvt_4uMuU606nXNbu-stw6bQ/edit
buildvariants:
- name: macos
display_name: MacOS
run_on: macos-1014-codesign
tasks:
- name: oneshot-compile-test-package-publish
- name: windows
display_name: Windows
run_on: windows-64-vs2015-test
expansions:
compass_distribution: compass
tasks:
- name: compile
- name: verify
# - name: test-data-service
# - name: test-functional
# - name: test-hadron-spectron
# - name: test-connect-plugin
# - name: test-aggregation-builder-plugin
# NOTE (@imlucas) See above for activating more tests
- name: test-unit
# - name: test-main
# - name: test-renderer
# - name: test-enzyme
# - name: test-functional-stable-server
# - name: test-functional-unstable-server
# - name: test-functional-36x-server
# - name: test-functional-34x-server
# - name: test-functional-26x-server
- name: package-and-publish-compass
- name: package-and-publish-compass-isolated
- name: package-and-publish-compass-readonly
- name: ubuntu
display_name: Ubuntu
run_on: ubuntu1404-test
tasks:
- name: compile
- name: verify
- name: test-data-service
# - name: test-unit
# - name: test-main
# - name: test-renderer
# - name: test-enzyme
# - name: test-functional
# - name: test-connect-plugin
# - name: test-aggregation-builder-plugin
- name: package-and-publish-compass
- name: package-and-publish-compass-isolated
- name: package-and-publish-compass-readonly
- name: rhel
display_name: RHEL
run_on: rhel70
tasks:
- name: compile
- name: verify
# - name: test-functional
- name: package-and-publish-compass
- name: package-and-publish-compass-isolated
- name: package-and-publish-compass-readonly