-
Notifications
You must be signed in to change notification settings - Fork 67
/
.evergreen.yml
298 lines (292 loc) · 7.78 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
exec_timeout_secs: 7200
# Variables for common functions.
#
# compile_and_release: Runs the exec compile and release process.
variables:
- &compile_and_release
command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
cat <<RELEASE_MONGOSH > ~/release_mongosh.sh
set -e
cd $(pwd)
source .evergreen/.setup_env
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
export EVERGREEN_EXPANSIONS_PATH="$(pwd)/../tmp/expansions.yaml"
npm run evergreen-release package
RELEASE_MONGOSH
if [ `uname` == Darwin ]; then
ssh -v -p 2222 localhost "bash ~/release_mongosh.sh"
else
bash ~/release_mongosh.sh
fi
ls -la dist/
- &compile_and_release_ps
command: shell.exec
params:
working_dir: src
shell: powershell
script: |
$ErrorActionPreference = "Stop"
.\.evergreen\SetupEnv
node --version
npm --version
$Env:PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = "true"
$Env:EVERGREEN_EXPANSIONS_PATH = $(Join-Path -Path '..' -ChildPath 'tmp/expansions.yaml' -Resolve)
npm run evergreen-release package
# Functions are any command that can be run.
#
# Current functions:
# checkout - Checks out the project from git.
# install - Installs Node and all dependencies.
# check - Performs linter and dependency checks.
# test - Runs all tests.
# release_macos - Publishes the npm packages and uploads the tarballs.
# release_linux - Publishes the npm packages and uploads the tarballs.
# release_win_ps - Publishes the npm packages and uploads the tarballs.
functions:
checkout:
- command: git.get_project
params:
directory: src
install:
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
source .evergreen/.install_node
install_ps:
- command: shell.exec
params:
working_dir: src
shell: powershell
script: |
.\.evergreen\InstallNode
check:
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
source .evergreen/.setup_env
npm run check-ci
check_ps:
- command: shell.exec
params:
working_dir: src
shell: powershell
script: |
.\.evergreen\SetupEnv
npm run check-ci
test:
- command: expansions.write
params:
file: tmp/expansions.yaml
redacted: true
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
source .evergreen/.setup_env
export EVERGREEN_EXPANSIONS_PATH="$(pwd)/../tmp/expansions.yaml"
export MONGOSH_TEST_EXECUTABLE_PATH="$(pwd)/dist/mongosh"
echo "$MONGOSH_TEST_EXECUTABLE_PATH"
npm run compile-exec
npm run test-ci
test_ps:
- command: expansions.write
params:
file: tmp\expansions.yaml
redacted: true
- command: shell.exec
params:
working_dir: src
shell: powershell
script: |
$ErrorActionPreference = "Stop"
.\.evergreen\SetupEnv
.\.evergreen\DownloadAndRunMongod
$Env:EVERGREEN_EXPANSIONS_PATH = $(Join-Path -Path '..' -ChildPath 'tmp/expansions.yaml' -Resolve)
npm run compile-exec
$Env:MONGOSH_TEST_EXECUTABLE_PATH = $(Join-Path -Path '.' -ChildPath 'dist/mongosh.exe' -Resolve)
$Env:MONGOSH_TEST_SERVER_URL = "mongodb://localhost:27018"
echo "$Env:MONGOSH_TEST_EXECUTABLE_PATH"
npm run test-ci
release_macos:
- command: expansions.write
params:
file: tmp/expansions.yaml
redacted: true
- <<: *compile_and_release
release_linux:
- command: expansions.write
params:
file: tmp/expansions.yaml
redacted: true
- <<: *compile_and_release
release_debian:
- command: expansions.write
params:
file: tmp/expansions.yaml
redacted: true
- <<: *compile_and_release
release_rhel:
- command: expansions.write
params:
file: tmp/expansions.yaml
redacted: true
- <<: *compile_and_release
release_win_ps:
- command: expansions.write
params:
file: tmp\expansions.yaml
redacted: true
- <<: *compile_and_release_ps
release_publish:
- command: expansions.write
params:
file: tmp/expansions.yaml
redacted: true
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
set -e
source .evergreen/.setup_env
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
export EVERGREEN_EXPANSIONS_PATH="$(pwd)/../tmp/expansions.yaml"
npm run evergreen-release publish
# Tasks will show up as the individual blocks in the Evergreen UI that can
# pass or fail.
#
# Current tasks:
# check - Performs linter and dependency checks.
# test - Runs all tests.
# release_macos - Publishes the npm packages and uploads the tarballs.
# release_linux - Publishes the npm packages and uploads the tarballs.
# release_win_ps - Publishes the npm packages and uploads the tarballs (from powershell).
tasks:
- name: check
commands:
- func: checkout
- func: install
- func: check
- name: check_ps
commands:
- func: checkout
- func: install_ps
- func: check_ps
- name: test
commands:
- func: checkout
- func: install
- func: test
- name: test_ps
commands:
- func: checkout
- func: install_ps
- func: test_ps
- name: release_macos
depends_on:
- name: check
- name: test
commands:
- func: checkout
- func: install
- func: release_macos
- name: release_linux
depends_on:
- name: check
- name: test
commands:
- func: checkout
- func: install
- func: release_linux
- name: release_debian
depends_on:
- name: check
- name: test
variant: linux
commands:
- func: checkout
- func: install
- func: release_debian
- name: release_rhel
depends_on:
- name: check
- name: test
variant: linux
commands:
- func: checkout
- func: install
- func: release_rhel
- name: release_win_ps
depends_on:
- name: check_ps
commands:
- func: checkout
- func: install_ps
- func: release_win_ps
- name: release_publish
depends_on:
- name: release_win_ps
variant: win32
- name: release_linux
variant: linux
- name: release_rhel
variant: rhel
- name: release_debian
variant: debian
- name: release_macos
variant: darwin
commands:
- func: checkout
- func: install
- func: release_publish
# Need to run builds for every possible build variant.
buildvariants:
- name: darwin
display_name: "MacOS Mohave"
run_on: macos-1014-codesign
tasks:
- name: check
- name: test
- name: release_macos
- name: linux
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-test
tasks:
- name: check
- name: test
- name: release_linux
- name: rhel
display_name: "RHEL 8.0"
run_on: rhel80-large
tasks:
- name: check
- name: release_rhel
- name: win32
display_name: "Windows VS 2019 PowerShell"
run_on: windows-64-vs2019-test
tasks:
- name: check_ps
- name: test_ps
- name: release_win_ps
- name: debian
display_name: "Debian 10"
run_on: debian10-large
tasks:
- name: check
- name: release_debian
- name: darwin_release_publish
display_name: "Publish Release"
run_on: macos-1014-codesign
tasks:
- name: release_publish