Skip to content

Commit 6a87f83

Browse files
committed
introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR
1 parent 07371e5 commit 6a87f83

File tree

2 files changed

+37
-9
lines changed

2 files changed

+37
-9
lines changed

lib/process-release.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,17 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
4949

5050
// check for the nvm.sh standard mirror env variables
5151
if (!overrideDistUrl) {
52-
if (isIojs && process.env.NVM_IOJS_ORG_MIRROR)
53-
overrideDistUrl = process.env.NVM_IOJS_ORG_MIRROR
54-
else if (process.env.NVM_NODEJS_ORG_MIRROR)
55-
overrideDistUrl = process.env.NVM_NODEJS_ORG_MIRROR
52+
if (isIojs) {
53+
if (process.env.IOJS_ORG_MIRROR)
54+
overrideDistUrl = process.env.IOJS_ORG_MIRROR
55+
else if (process.env.NVM_IOJS_ORG_MIRROR) // remove on next semver-major
56+
overrideDistUrl = process.env.NVM_IOJS_ORG_MIRROR
57+
} else {
58+
if (process.env.NODEJS_ORG_MIRROR)
59+
overrideDistUrl = process.env.NODEJS_ORG_MIRROR
60+
else if (process.env.NVM_NODEJS_ORG_MIRROR) // remove on next semver-major
61+
overrideDistUrl = process.env.NVM_NODEJS_ORG_MIRROR
62+
}
5663
}
5764

5865

test/docker.sh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
#set -e
44

5-
test_node_versions="0.8.28 0.10.40 0.12.7"
5+
test_node_versions="0.8.28 0.10.40 0.12.7 4.3.0 5.6.0"
66
test_iojs_versions="1.8.4 2.4.0 3.3.0"
77

8+
myuid=$(id -u)
9+
mygid=$(id -g)
810
__dirname="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
911
dot_node_gyp=${__dirname}/.node-gyp/
1012

@@ -41,6 +43,7 @@ run_tests() {
4143
/bin/su -s /bin/bash node-gyp -c 'cd && ${run_cmd}'"
4244

4345
rm -rf $dot_node_gyp
46+
mkdir $dot_node_gyp
4447

4548
docker run \
4649
--rm -i \
@@ -52,10 +55,10 @@ run_tests() {
5255

5356
# A base image with build tools and a user account
5457
setup_container "node-gyp-test/base" "ubuntu:14.04" "
58+
adduser --gecos node-gyp --home /node-gyp/ --disabled-login node-gyp --uid $myuid &&
59+
echo "node-gyp:node-gyp" | chpasswd &&
5560
apt-get update &&
56-
apt-get install -y build-essential python git rsync curl &&
57-
adduser --gecos node-gyp --home /node-gyp/ --disabled-login node-gyp &&
58-
echo "node-gyp:node-gyp" | chpasswd
61+
apt-get install -y build-essential python git rsync curl
5962
"
6063

6164
# An image on top of the base containing clones of repos we want to use for testing
@@ -111,7 +114,9 @@ test_download_node_version() {
111114
test_download_node_version "0.12.7" "0.10.30/src" "0.10.30"
112115
test_download_node_version "3.3.0" "iojs-1.8.4/src" "1.8.4"
113116
# should download the headers file
114-
test_download_node_version "3.3.0" "iojs-3.2.0/include/node" "3.2.0"
117+
test_download_node_version "3.3.0" "iojs-3.3.0/include/node" "3.3.0"
118+
test_download_node_version "4.3.0" "4.3.0/include/node" "4.3.0"
119+
test_download_node_version "5.6.0" "5.6.0/include/node" "5.6.0"
115120

116121
# TODO: test --dist-url by starting up a localhost server and serving up tarballs
117122

@@ -126,18 +131,34 @@ run_tests "3.3.0" "
126131
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
127132
"
128133

134+
# REMOVE after next semver-major
129135
run_tests "3.3.0" "
130136
(node /node-gyp-src/test/simple-proxy.js 8080 /doobar/ https://iojs.org/dist/ &) &&
131137
cd node-buffertools &&
132138
NVM_IOJS_ORG_MIRROR=http://localhost:8080/doobar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild &&
133139
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
134140
"
135141

142+
# REMOVE after next semver-major
136143
run_tests "0.12.7" "
137144
(node /node-gyp-src/test/simple-proxy.js 8080 /boombar/ https://nodejs.org/dist/ &) &&
138145
cd node-buffertools &&
139146
NVM_NODEJS_ORG_MIRROR=http://localhost:8080/boombar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild &&
140147
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
141148
"
142149

150+
run_tests "3.3.0" "
151+
(node /node-gyp-src/test/simple-proxy.js 8080 /doobar/ https://iojs.org/dist/ &) &&
152+
cd node-buffertools &&
153+
IOJS_ORG_MIRROR=http://localhost:8080/doobar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild &&
154+
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
155+
"
156+
157+
run_tests "0.12.7" "
158+
(node /node-gyp-src/test/simple-proxy.js 8080 /boombar/ https://nodejs.org/dist/ &) &&
159+
cd node-buffertools &&
160+
NODEJS_ORG_MIRROR=http://localhost:8080/boombar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild &&
161+
nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\"
162+
"
163+
143164
rm -rf $dot_node_gyp

0 commit comments

Comments
 (0)