Skip to content

Commit edd2186

Browse files
committed
Refactor preinstall.sh into an earlier install-node.sh
1 parent 6a1610e commit edd2186

File tree

6 files changed

+59
-60
lines changed

6 files changed

+59
-60
lines changed

.evergreen/functions.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,11 @@ functions:
149149
<<: *compass-env
150150
script: |
151151
set -e
152-
eval $(.evergreen/print-compass-env.sh)
153-
154-
# Make all the dirs
155-
mkdir -p $ARTIFACTS_PATH
152+
.evergreen/install-node.sh
156153
157-
- command: shell.exec
158-
type: setup
159-
params:
160-
working_dir: src
161-
shell: bash
162-
env:
163-
<<: *compass-env
164-
script: |
165-
set -e
166154
eval $(.evergreen/print-compass-env.sh)
167155
168-
.evergreen/preinstall.sh
156+
.evergreen/print-debug-info.sh
169157
170158
# Make sure install worked
171159
echo "Using node version:";

.evergreen/preinstall.sh renamed to .evergreen/install-node.sh

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,7 @@
22

33
set -e
44

5-
echo "========================="
6-
echo "Important Environment Variables"
7-
echo "========================="
8-
echo "PLATFORM: $PLATFORM"
9-
echo "ARCH: $ARCH"
10-
echo "NODE_JS_VERSION: $NODE_JS_VERSION"
11-
echo "NPM_VERSION: $NPM_VERSION"
12-
echo "APPDATA: $APPDATA"
13-
echo "PATH: $PATH"
14-
15-
# these are super useful if you want to run the smoke tests locally
16-
echo "export DEV_VERSION_IDENTIFIER=$DEV_VERSION_IDENTIFIER"
17-
echo "export EVERGREEN_BUCKET_KEY_PREFIX=$EVERGREEN_BUCKET_KEY_PREFIX"
18-
echo "export EVERGREEN_BUCKET_NAME=$EVERGREEN_BUCKET_NAME"
19-
20-
echo "IS_OSX: $IS_OSX"
21-
echo "IS_LINUX: $IS_LINUX"
22-
echo "IS_WINDOWS: $IS_WINDOWS"
23-
echo "IS_RHEL: $IS_RHEL"
24-
echo "IS_UBUNTU: $IS_UBUNTU"
25-
26-
echo "DOCKER_CONFIG: $DOCKER_CONFIG"
5+
source ./set-platform-env.sh
276

287
SCRIPTDIR="$(cd $(dirname "$0"); pwd)"
298

.evergreen/print-compass-env.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /usr/bin/env node
22
'use strict';
3-
const path = require('path');
3+
const path = require('node:path');
4+
const fs = require('node:fs');
45

56
/*
67
This script writes a bash script that can be eval()'d in evergreen to modify the
@@ -84,7 +85,11 @@ function printCompassEnv() {
8485
// to be a non-cygwin path
8586
const npmCacheDir = path.resolve(__dirname, '..', '.deps', '.npm-cache');
8687

87-
printVar('ARTIFACTS_PATH', `${newPWD}/.deps`);
88+
const artifactsPath = path.resolve(newPWD, '.deps');
89+
if (!fs.existsSync(artifactsPath)) {
90+
fs.mkdirSync(artifactsPath, { recursive: true });
91+
}
92+
8893
printVar('NPM_CACHE_DIR', npmCacheDir);
8994

9095
// all npm var names need to be lowercase

.evergreen/print-compass-env.sh

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,7 @@
22

33
set -e
44

5-
if [[ $OSTYPE == "cygwin" ]]; then
6-
export PLATFORM='win32'
7-
export IS_WINDOWS=true
8-
export ARCH=x64
9-
elif [[ $(uname) == Darwin ]]; then
10-
export PLATFORM='darwin'
11-
export IS_OSX=true
12-
if [ `uname -m` = x86_64 ]; then
13-
export ARCH=x64
14-
else
15-
export ARCH=arm64
16-
fi
17-
else
18-
export PLATFORM='linux'
19-
export IS_LINUX=true
20-
export ARCH=x64
21-
if [[ $(cat /etc/*release | grep ^NAME | grep Red) ]]; then
22-
export IS_RHEL=true
23-
elif [[ $(cat /etc/*release | grep ^NAME | grep Ubuntu) ]]; then
24-
export IS_UBUNTU=true
25-
fi
26-
fi
5+
source ./set-platform-env.sh
276

287
export BASHPATH="$PATH"
298
export OSTYPE="$OSTYPE"

.evergreen/print-debug-info.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#! /usr/bin/env bash
2+
3+
echo "========================="
4+
echo "Important Environment Variables"
5+
echo "========================="
6+
echo "PLATFORM: $PLATFORM"
7+
echo "ARCH: $ARCH"
8+
echo "NODE_JS_VERSION: $NODE_JS_VERSION"
9+
echo "NPM_VERSION: $NPM_VERSION"
10+
echo "APPDATA: $APPDATA"
11+
echo "PATH: $PATH"
12+
13+
# these are super useful if you want to run the smoke tests locally
14+
echo "export DEV_VERSION_IDENTIFIER=$DEV_VERSION_IDENTIFIER"
15+
echo "export EVERGREEN_BUCKET_KEY_PREFIX=$EVERGREEN_BUCKET_KEY_PREFIX"
16+
echo "export EVERGREEN_BUCKET_NAME=$EVERGREEN_BUCKET_NAME"
17+
18+
echo "IS_OSX: $IS_OSX"
19+
echo "IS_LINUX: $IS_LINUX"
20+
echo "IS_WINDOWS: $IS_WINDOWS"
21+
echo "IS_RHEL: $IS_RHEL"
22+
echo "IS_UBUNTU: $IS_UBUNTU"
23+
24+
echo "DOCKER_CONFIG: $DOCKER_CONFIG"

.evergreen/set-platform-env.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#! /usr/bin/env bash
2+
3+
if [[ $OSTYPE == "cygwin" ]]; then
4+
export PLATFORM='win32'
5+
export IS_WINDOWS=true
6+
export ARCH=x64
7+
elif [[ $(uname) == Darwin ]]; then
8+
export PLATFORM='darwin'
9+
export IS_OSX=true
10+
if [ `uname -m` = x86_64 ]; then
11+
export ARCH=x64
12+
else
13+
export ARCH=arm64
14+
fi
15+
else
16+
export PLATFORM='linux'
17+
export IS_LINUX=true
18+
export ARCH=x64
19+
if [[ $(cat /etc/*release | grep ^NAME | grep Red) ]]; then
20+
export IS_RHEL=true
21+
elif [[ $(cat /etc/*release | grep ^NAME | grep Ubuntu) ]]; then
22+
export IS_UBUNTU=true
23+
fi
24+
fi

0 commit comments

Comments
 (0)