Skip to content

Commit 76e8845

Browse files
committed
INT-589 Enable Linux build, pull OSX/Linux node tarballs from S3
1 parent 4fe9dc8 commit 76e8845

File tree

1 file changed

+100
-76
lines changed

1 file changed

+100
-76
lines changed

.evergreen.yml

Lines changed: 100 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
# Evergreen CI configuration
2-
# Derived from sample at https://github.com/evergreen-ci/evergreen/blob/master/config_dev/project/sample.yml
1+
#######################################################################################
2+
# Compass Evergreen CI configuration
3+
#
4+
# References:
5+
# https://github.com/evergreen-ci/evergreen/wiki/Project-Files
6+
# https://github.com/evergreen-ci/evergreen/blob/master/config_dev/project/sample.yml
7+
#######################################################################################
38

49
stepback: false
510

@@ -21,95 +26,120 @@ functions:
2126
- command: git.apply_patch
2227
params:
2328
directory: src
24-
"upgrade npm" :
29+
30+
"fetch npm tarball" :
2531
- command: shell.exec
2632
params:
2733
working_dir: src
2834
script: |
29-
set -o errexit
30-
set -o verbose
31-
export PATH="$PATH:${node_path|}"
32-
test -n "${add_environment|}" && export "${add_environment|}"
35+
mkdir .deps
36+
- command: s3.get
37+
params:
38+
aws_key: ${aws_key_evergreen_integrations}
39+
aws_secret: ${aws_secret_evergreen_integrations}
40+
bucket: mongodb-dx-public
41+
remote_file: evergreen-deps/${fetch_npm_tarball}
42+
local_file: src/.deps/${fetch_npm_tarball}
43+
- command: shell.exec
44+
params:
45+
working_dir: src/.deps
46+
script: |
47+
set -ev
48+
tar xzf ${fetch_npm_tarball} --strip-components=1
49+
ls
3350
51+
# THIS COMMAND WORKS ON WINDOWS ONLY, SHOULD BE CONSIDERED OBSOLETE
52+
"upgrade npm windows" :
53+
- command: shell.exec
54+
params:
55+
working_dir: src
56+
script: |
57+
set -ev
58+
test -n "${add_environment|}" && export "${add_environment|}"
59+
export PATH="$PATH:${node_path|}"
3460
if [ -z "${npm_version|}" ]
3561
then
3662
echo "upgrade_npm: npm_version is unset; skipping"
3763
exit 0
3864
fi
3965
${npm|npm} install -g npm@${npm_version|xx}
66+
4067
"npm install" :
4168
- command: shell.exec
4269
params:
4370
working_dir: src
4471
script: |
45-
set -v -e
46-
export PATH="$PATH:${node_path|}"
72+
set -ev
4773
test -n "${add_environment|}" && export "${add_environment|}"
74+
export PATH="$PATH:${node_path|}"
4875
export PATH="`npm -g bin`:$PATH"
4976
${node|node} --version
5077
${npm|npm} --version
78+
${npm|npm} config set loglevel error
79+
${npm|npm} config -g list -l
5180
${npm|npm} install
52-
"npm test" :
53-
- command: shell.exec
54-
params:
55-
working_dir: src
56-
script: |
57-
set -v -e
58-
export PATH="$PATH:${node_path|}"
59-
test -n "${add_environment|}" && export "${add_environment|}"
60-
export PATH="`npm -g bin`:$PATH"
61-
${npm|npm} run test
62-
"npm check" :
81+
82+
"build" :
6383
- command: shell.exec
6484
params:
6585
working_dir: src
6686
script: |
67-
set -v -e
68-
export PATH="$PATH:${node_path|}"
87+
set -ev
6988
test -n "${add_environment|}" && export "${add_environment|}"
70-
export PATH="`npm -g bin`:$PATH"
71-
${npm|npm} run check
72-
"npm release" :
73-
- command: shell.exec
74-
params:
75-
working_dir: src
76-
script: |
77-
set -v -e
7889
export PATH="$PATH:${node_path|}"
79-
test -n "${add_environment|}" && export "${add_environment|}"
8090
export PATH="`npm -g bin`:$PATH"
91+
${npm|npm} run ci
92+
${npm|npm} run test
8193
${npm|npm} run release
8294
95+
"save release":
96+
- command: s3.put
97+
params:
98+
aws_key: ${aws_key}
99+
aws_secret: ${aws_secret}
100+
local_file: "src/dist/${installer_filename}"
101+
remote_file: "mongodbjs-scout-master/${build_variant}/${revision}/${installer_filename}"
102+
bucket: mciuploads
103+
permissions: public-read
104+
content_type: ${installer_content_type|application/octet-stream}
105+
display_name: "Installer: ${installer_filename}"
106+
83107
#######################################
84108
# Tasks #
85109
#######################################
86110

111+
# FIXME: simplify to one "compile" task as soon as we can hammer out the irregularities
112+
# between the platforms:
113+
# - one way of installing Node
114+
# - build artifacts for all platforms
115+
87116
tasks:
88-
- name: compile
117+
- name: compile_osx
89118
depends_on: []
90119
commands:
91120
- func: "fetch source"
92-
- func: "upgrade npm"
121+
- func: "fetch npm tarball"
93122
- func: "npm install"
94-
- func: "npm test"
95-
# - func: "npm check"
96-
- func: "npm release"
97-
- command: s3.put
98-
params:
99-
aws_key: ${aws_key}
100-
aws_secret: ${aws_secret}
101-
local_file: "src/dist/${installer_filename}"
102-
remote_file: "mongodbjs-scout-master/${build_variant}/${revision}/${installer_filename}"
103-
bucket: mciuploads
104-
permissions: public-read
105-
content_type: ${installer_content_type|application/octet-stream}
106-
display_name: "Installer: ${installer_filename}"
107-
108-
# - name: test
109-
# depends_on:
110-
# - name: compile
111-
# commands:
112-
# - func: "npm test"
123+
- func: "build"
124+
- func: "save release"
125+
126+
- name: compile_windows
127+
depends_on: []
128+
commands:
129+
- func: "fetch source"
130+
- func: "upgrade npm windows"
131+
- func: "npm install"
132+
- func: "build"
133+
- func: "save release"
134+
135+
- name: compile_linux
136+
depends_on: []
137+
commands:
138+
- func: "fetch source"
139+
- func: "fetch npm tarball"
140+
- func: "npm install"
141+
- func: "build"
142+
# - func: "save release"
113143

114144

115145
#######################################
@@ -123,14 +153,13 @@ buildvariants:
123153
run_on:
124154
- "osx-108"
125155
expansions:
126-
add_environment: "SCOUT_INSTALLER_UNSIGNED=1"
127-
node_path: /opt/node/bin
156+
fetch_npm_tarball: node-v0.12.7-npm-3.3.5-darwin-x64.tgz
157+
node_path: "$(pwd)/.deps/bin"
128158
installer_content_type: "application/x-apple-diskimage"
129159
installer_filename: "MongoDB Compass.dmg"
130160
num_cores: $(sysctl -n hw.logicalcpu)
131161
tasks:
132-
- name: compile
133-
# - name: test
162+
- name: compile_osx
134163

135164
- name: windows-64
136165
display_name: Windows 64-bit
@@ -139,28 +168,23 @@ buildvariants:
139168
- "windows-64-vs2013-test"
140169
expansions:
141170
add_environment: "APPDATA=C:\\Program Files (x86)\\nodejs\\node_modules"
171+
npm_version: "3"
142172
node_path: "/cygdrive/c/Program Files (x86)/nodejs"
143173
installer_content_type: "application/octet-stream"
144174
installer_filename: "MongoDBCompassSetup.exe"
145-
exe: ".exe"
146-
npm_version: "3"
147175
num_cores: $(grep -c ^processor /proc/cpuinfo)
148176
tasks:
149-
- name: compile
150-
# - name: test
151-
152-
## ubuntu buildvariant is ready to go when we're ready to add tasks/linux.js
153-
154-
# - name: ubuntu
155-
# display_name: Ubuntu
156-
# modules: ~
157-
# run_on:
158-
# - "ubuntu1404-test"
159-
# expansions:
160-
# add_environment: ""
161-
# node_path: "/opt/node/bin"
162-
# compile_env: CC=/opt/mongodbtoolchain/bin/gcc CXX=/opt/mongodbtoolchain/bin/g++
163-
# num_cores: $(grep -c ^processor /proc/cpuinfo)
164-
# tasks:
165-
# - name: compile
166-
# # - name: test
177+
- name: compile_windows
178+
179+
- name: ubuntu
180+
display_name: Ubuntu 14.04
181+
modules: ~
182+
run_on:
183+
- "ubuntu1404-test"
184+
expansions:
185+
fetch_npm_tarball: node-v0.12.7-npm-3.3.5-linux-x64.tar.gz
186+
node_path: "$(pwd)/.deps/bin"
187+
compile_env: CC=/opt/mongodbtoolchain/bin/gcc CXX=/opt/mongodbtoolchain/bin/g++
188+
num_cores: $(grep -c ^processor /proc/cpuinfo)
189+
tasks:
190+
- name: compile_linux

0 commit comments

Comments
 (0)