Skip to content

Commit 6d306e2

Browse files
committed
WIP
1 parent b8574a3 commit 6d306e2

File tree

5 files changed

+55
-23
lines changed

5 files changed

+55
-23
lines changed

.evergreen.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ functions:
122122
DISTRO_ID: ${distro_id}
123123
MONOGDB_DRIVER_VERSION_OVERRIDE: ${mongodb_driver_version_override}
124124
script: |
125-
source .evergreen/install-node.sh
126-
source .evergreen/install-npm-deps.sh
125+
set -e
126+
set -x
127+
.evergreen/install-node.sh
128+
.evergreen/install-npm-deps.sh
127129
- command: shell.exec
128130
params:
129131
working_dir: src
@@ -160,8 +162,10 @@ functions:
160162
DISTRO_ID: ${distro_id}
161163
MONOGDB_DRIVER_VERSION_OVERRIDE: ${mongodb_driver_version_override}
162164
script: |
163-
source .evergreen/install-node.sh
164-
source .evergreen/install-npm-deps.sh
165+
set -e
166+
set -x
167+
.evergreen/install-node.sh
168+
.evergreen/install-npm-deps.sh
165169
- command: s3.get
166170
type: setup
167171
params:

.evergreen/evergreen.yml.in

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ functions:
131131
DISTRO_ID: ${distro_id}
132132
MONOGDB_DRIVER_VERSION_OVERRIDE: ${mongodb_driver_version_override}
133133
script: |
134-
source .evergreen/install-node.sh
135-
source .evergreen/install-npm-deps.sh
134+
set -e
135+
set -x
136+
.evergreen/install-node.sh
137+
.evergreen/install-npm-deps.sh
136138
- command: shell.exec
137139
params:
138140
working_dir: src
@@ -169,8 +171,10 @@ functions:
169171
DISTRO_ID: ${distro_id}
170172
MONOGDB_DRIVER_VERSION_OVERRIDE: ${mongodb_driver_version_override}
171173
script: |
172-
source .evergreen/install-node.sh
173-
source .evergreen/install-npm-deps.sh
174+
set -e
175+
set -x
176+
.evergreen/install-node.sh
177+
.evergreen/install-npm-deps.sh
174178
- command: s3.get
175179
type: setup
176180
params:

.evergreen/install-node.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23
set -x
34
export BASEDIR="$PWD/.evergreen"
@@ -12,6 +13,19 @@ if [ "$OS" == "Windows_NT" ]; then
1213

1314
curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh
1415
else
16+
if [ `uname` = Darwin ]; then
17+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
18+
19+
echo "Setting NVM environment home: $NVM_DIR"
20+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
21+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
22+
set +x # nvm is very verbose
23+
echo nvm install --no-progress $NODE_JS_VERSION && nvm alias default $NODE_JS_VERSION
24+
nvm install --no-progress $NODE_JS_VERSION
25+
nvm alias default $NODE_JS_VERSION
26+
nvm use $NODE_JS_VERSION
27+
set -x
28+
fi
1529
npm cache clear --force || true # Try to work around `Cannot read property 'pickAlgorithm' of null` errors in CI
1630
fi
1731

.evergreen/install-npm-deps.sh

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -e
23
set -x
34

.evergreen/setup-env.sh

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -x
44
OS_ARCH="$(uname "-m")"
55

66
export BASEDIR="$PWD/.evergreen"
7-
export PATH="/opt/devtools/bin:/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:/cygdrive/c/Python311/Scripts:/cygdrive/c/Python311:/opt/python/3.6/bin:$BASEDIR/mingit/cmd:$BASEDIR/mingit/mingw64/libexec/git-core:$BASEDIR/git-2:$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:/opt/chefdk/gitbin:/cygdrive/c/cmake/bin:$PATH"
7+
export PATH="$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:$PATH"
88

99
export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../testing/tests-globalconfig.conf"
1010

@@ -18,25 +18,25 @@ if [ x"$TERM" = x"dumb" ]; then
1818
fi
1919
echo "TERM variable is set to '${TERM:-}'"
2020

21-
NODE_JS_MAJOR_VERSION=$(echo "$NODE_JS_VERSION" | awk -F . '{print $1}')
22-
if echo "$NODE_JS_MAJOR_VERSION" | grep -q '^[0-9]*$'; then
23-
export PATH="/opt/devtools/node20/bin:$PATH"
24-
echo "Detected Node.js version (requested v${NODE_JS_MAJOR_VERSION}.x):"
25-
node -v
26-
node -v | grep -q "^v$NODE_JS_MAJOR_VERSION"
27-
else
28-
echo "Cannot identify major version from NODE_JS_VERSION: $NODE_JS_VERSION"
29-
exit 1
30-
fi
31-
3221
if [ "$OS" != "Windows_NT" ]; then
3322
if [ `uname` = Darwin ]; then
3423
echo "Using clang version:"
3524
(which clang && clang --version)
3625

3726
echo "Using clang++ version:"
3827
(which clang++ && clang++ --version)
28+
29+
export NVM_DIR="$BASEDIR/.nvm"
30+
echo "Setting NVM environment home: $NVM_DIR"
31+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
32+
set +x # nvm is very verbose
33+
echo nvm use $NODE_JS_VERSION || nvm use 20.11.1
34+
nvm use $NODE_JS_VERSION || nvm use 20.11.1 # see install-node.sh
35+
set -x
36+
export PATH="$NVM_BIN:$PATH"
3937
else
38+
export PATH="/opt/devtools/bin:$PATH"
39+
export GIT_EXEC_PATH="/opt/devtools/libexec/git-core"
4040
export CC=gcc
4141
export CXX=g++
4242

@@ -46,10 +46,19 @@ if [ "$OS" != "Windows_NT" ]; then
4646
echo "Using g++ version:"
4747
(which g++ && g++ --version)
4848
fi
49+
else
50+
export PATH="/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:/cygdrive/c/Python311/Scripts:/cygdrive/c/Python311:/cygdrive/c/cmake/bin:$PATH"
51+
fi
4952

50-
if [ -x "$BASEDIR/git-2/git" ]; then
51-
export GIT_EXEC_PATH="$BASEDIR/git-2"
52-
fi
53+
NODE_JS_MAJOR_VERSION=$(echo "$NODE_JS_VERSION" | awk -F . '{print $1}')
54+
if echo "$NODE_JS_MAJOR_VERSION" | grep -q '^[0-9]*$'; then
55+
export PATH="/opt/devtools/node$NODE_JS_MAJOR_VERSION/bin:$PATH"
56+
echo "Detected Node.js version (requested v${NODE_JS_MAJOR_VERSION}.x):"
57+
node -v
58+
node -v | grep -q "^v$NODE_JS_MAJOR_VERSION"
59+
else
60+
echo "Cannot identify major version from NODE_JS_VERSION: $NODE_JS_VERSION"
61+
exit 1
5362
fi
5463

5564
export EVERGREEN_EXPANSIONS_PATH="$BASEDIR/../../tmp/expansions.yaml"

0 commit comments

Comments
 (0)