8
8
9
9
stepback : false
10
10
11
- pre :
12
- - command : shell.track
13
-
14
- post :
15
- - command : shell.cleanup
16
-
17
11
variables :
18
- # function "fetch npm tarball" is conditional on the following
12
+ # function "fetch npm tarball" is conditional on {fetch_npm_tarball}
19
13
# -> all except windows
20
- - &fetch_npm_tarball_variants
21
- - osx-108
22
- - ubuntu
23
14
24
15
# function "upgrade npm windows" is conditional based on {upgrade_npm_version}
25
16
# as set in the buildvariant declaration
@@ -44,100 +35,124 @@ functions:
44
35
- command : git.apply_patch
45
36
params :
46
37
directory : src
47
- - command : shell.exec
48
- params :
49
- working_dir : src
50
- script : |
51
- mkdir .deps
52
38
53
39
# Install node,npm from a tarball in S3 to src/.deps/bin
54
40
# To use "npm" installed by this, each shell.exec script must add:
55
41
# export PATH="$PATH:${node_path|}"
56
- " fetch npm tarball" :
57
- - command : s3.get
58
- params :
59
- build_variants :
60
- *fetch_npm_tarball_variants
61
- aws_key : ${aws_key_evergreen_integrations}
62
- aws_secret : ${aws_secret_evergreen_integrations}
63
- bucket : mongodb-dx-public
64
- remote_file : evergreen-deps/${fetch_npm_tarball}
65
- local_file : src/.deps/${fetch_npm_tarball}
66
- - command : shell.exec
67
- params :
68
- working_dir : src/.deps
69
- script : |
70
- if [ -z "${fetch_npm_tarball|}" ]; then
71
- echo "fetch_npm_tarball: fetch_npm_tarball is unset; skipping"
72
- exit 0
73
- fi
74
- set -ev
75
- tar xzf ${fetch_npm_tarball} --strip-components=1
76
- ls
42
+ #
43
+ # Only when this is a single-step command can we reuse via *fetch_npm_tarball below.
44
+ #
45
+ # Ubuntu: has curl+wget
46
+ # Windows: has curl
47
+ # OSX: has curl
48
+ #
49
+ # So we use curl.
50
+ # Tried "command: s3.get" but it's challenging to blend into "setup ci" below.
51
+ # Also, command "s3.get"s extract_to target chokes on symlinks. EVG-609.
52
+ #
53
+ " fetch npm tarball" : &fetch_npm_tarball
54
+ command : shell.exec
55
+ params :
56
+ working_dir : src
57
+ script : |
58
+ mkdir -p .deps
59
+ set -ev
60
+ if [ -z "${fetch_npm_tarball|}" ]; then
61
+ echo "fetch_npm_tarball: fetch_npm_tarball is unset; skipping"
62
+ exit 0
63
+ fi
64
+ curl -fs \
65
+ -o ".deps/${fetch_npm_tarball}" \
66
+ --url "http://mongodb-dx-public.s3.amazonaws.com/evergreen-deps/${fetch_npm_tarball}"
67
+ cd .deps
68
+ tar xzf ${fetch_npm_tarball} --strip-components=1
77
69
78
70
# THIS COMMAND WORKS ON WINDOWS ONLY, SHOULD BE CONSIDERED OBSOLETE
79
71
# To use "npm" installed by this, each shell.exec script must add:
80
72
# export PATH="`npm -g bin`:$PATH"
81
- " upgrade npm windows" :
82
- - command : shell.exec
83
- params :
84
- working_dir : src
85
- script : |
86
- if [ -z "${upgrade_npm_version|}" ]; then
87
- echo "upgrade_npm: upgrade_npm_version is unset; skipping"
88
- exit 0
89
- fi
90
- set -ev
91
- test -n "${add_environment |}" && export "${add_environment |}"
92
- export PATH="$PATH:${node_path|}"
93
- ${npm|npm} install -g npm@${upgrade_npm_version|xx}
73
+ " upgrade npm windows" : &upgrade_npm_windows
74
+ command : shell.exec
75
+ params :
76
+ working_dir : src
77
+ script : |
78
+ if [ -z "${upgrade_npm_version|}" ]; then
79
+ echo "upgrade_npm: upgrade_npm_version is unset; skipping"
80
+ exit 0
81
+ fi
82
+ set -ev
83
+ test -n "${node_environment |}" && export "${node_environment |}"
84
+ export PATH="$PATH:${node_path|}"
85
+ ${npm|npm} install -g npm@${upgrade_npm_version|xx}
94
86
95
87
" npm install" :
96
- - command : shell.exec
97
- params :
98
- working_dir : src
99
- script : |
100
- set -ev
101
- test -n "${add_environment |}" && export "${add_environment |}"
102
- export PATH="$PATH:${node_path|}"
103
- export PATH="`npm -g bin`:$PATH"
104
- ${node|node} --version
105
- ${npm|npm} --version
106
- ${npm|npm} config set loglevel error
107
- ${npm|npm} config -g list -l
108
- ${npm|npm} install
88
+ command : shell.exec
89
+ params :
90
+ working_dir : src
91
+ script : |
92
+ set -ev
93
+ test -n "${node_environment |}" && export "${node_environment |}"
94
+ export PATH="$PATH:${node_path|}"
95
+ export PATH="`npm -g bin`:$PATH"
96
+ ${node|node} --version
97
+ ${npm|npm} --version
98
+ ${npm|npm} config set loglevel error
99
+ ${npm|npm} config -g list -l
100
+ ${npm|npm} install
109
101
110
102
" build" :
111
- - command : shell.exec
112
- params :
113
- working_dir : src
114
- script : |
115
- set -ev
116
- test -n "${add_environment|}" && export "${add_environment|}"
117
- export PATH="$PATH:${node_path|}"
118
- export PATH="`npm -g bin`:$PATH"
119
- ${npm|npm} run ci
120
- ${npm|npm} run test
121
- ${npm|npm} run release
103
+ command : shell.exec
104
+ params :
105
+ working_dir : src
106
+ script : |
107
+ set -ev
108
+ test -n "${node_environment|}" && export "${node_environment|}"
109
+ export PATH="$PATH:${node_path|}"
110
+ export PATH="`npm -g bin`:$PATH"
111
+ export CI=1 EVERGREEN=1
112
+ test -n "${add_environment|}" && export ${add_environment|}
113
+ ${npm|npm} run ci
114
+ ${npm|npm} run test
115
+ ${npm|npm} run release
122
116
123
117
" save release " :
124
- - command : s3.put
125
- params :
126
- build_variants :
127
- *save_release_variants
128
- aws_key : ${aws_key}
129
- aws_secret : ${aws_secret}
130
- local_file : " src/dist/${installer_filename}"
131
- remote_file : " mongodbjs-scout-master/${build_variant}/${revision}/${installer_filename}"
132
- bucket : mciuploads
133
- permissions : public-read
134
- content_type : ${installer_content_type|application/octet-stream}
135
- display_name : " Installer: ${installer_filename}"
118
+ command : s3.put
119
+ params :
120
+ build_variants :
121
+ *save_release_variants
122
+ aws_key : ${aws_key}
123
+ aws_secret : ${aws_secret}
124
+ local_file : " src/dist/${installer_filename}"
125
+ remote_file : " mongodbjs-scout-master/${build_variant}/${revision}/${installer_filename}"
126
+ bucket : mciuploads
127
+ permissions : public-read
128
+ content_type : ${installer_content_type|application/octet-stream}
129
+ display_name : " Installer: ${installer_filename}"
130
+
136
131
137
132
# ######################################
138
133
# Tasks #
139
134
# ######################################
140
135
136
+ pre :
137
+ - command : shell.track
138
+ - command : shell.exec
139
+ params :
140
+ silent : true
141
+ script : |
142
+ ${killall_evergreen|pkill -9 mongod; pkill -9 mongos; pkill -9 mongo} >/dev/null 2>&1
143
+ rm -rf src /data/db/*
144
+ mkdir -p src
145
+
146
+ post :
147
+ - command : shell.exec
148
+ params :
149
+ silent : true
150
+ script : |
151
+ ${killall_evergreen|pkill -9 mongod; pkill -9 mongos; pkill -9 mongo} >/dev/null 2>&1
152
+ exit 0
153
+ - command : shell.cleanup
154
+
155
+
141
156
tasks :
142
157
- name : compile
143
158
depends_on : []
@@ -149,6 +164,10 @@ tasks:
149
164
- func : " build"
150
165
- func : " save release"
151
166
167
+ # Define shortcut for use below
168
+ variables :
169
+ - &all_tasks
170
+ - name : compile
152
171
153
172
# ######################################
154
173
# Buildvariants #
@@ -167,22 +186,22 @@ buildvariants:
167
186
installer_filename : " MongoDB Compass.dmg"
168
187
num_cores : $(sysctl -n hw.logicalcpu)
169
188
tasks :
170
- - name : compile
189
+ *all_tasks
171
190
172
191
- name : windows-64
173
192
display_name : Windows 64-bit
174
193
modules : ~
175
194
run_on :
176
195
- " windows-64-vs2013-test"
177
196
expansions :
178
- add_environment : " APPDATA=C:\\ Program Files (x86)\\ nodejs\\ node_modules"
197
+ node_environment : " APPDATA=C:\\ Program Files (x86)\\ nodejs\\ node_modules"
179
198
upgrade_npm_version : " 3"
180
199
node_path : " /cygdrive/c/Program Files (x86)/nodejs"
181
200
installer_content_type : " application/octet-stream"
182
201
installer_filename : " MongoDBCompassSetup.exe"
183
202
num_cores : $(grep -c ^processor /proc/cpuinfo)
184
203
tasks :
185
- - name : compile
204
+ *all_tasks
186
205
187
206
- name : ubuntu
188
207
display_name : Ubuntu 14.04
@@ -195,4 +214,4 @@ buildvariants:
195
214
compile_env : CC=/opt/mongodbtoolchain/bin/gcc CXX=/opt/mongodbtoolchain/bin/g++
196
215
num_cores : $(grep -c ^processor /proc/cpuinfo)
197
216
tasks :
198
- - name : compile
217
+ *all_tasks
0 commit comments