Skip to content
This repository was archived by the owner on Dec 3, 2018. It is now read-only.

Commit e6e32b5

Browse files
committed
Consistify handling of NAME env var.
1 parent 766c9b6 commit e6e32b5

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

build_source.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@ set -e -u
1414

1515
CWD=$(pwd)
1616
BUILD_DIR=/tmp/v${NODE_VERSION}
17-
NAMEPATH=""
1817

1918
if [ -n "$NAME" ]; then
20-
NAMEPATH="/$NAME"
19+
S3_URL="$S3_URL/$NAME"
2120
fi
2221

2322
git clone https://github.com/mapbox/node.git -b ${BRANCH} $BUILD_DIR
2423
cd $BUILD_DIR
2524
./configure --prefix=$BUILD_DIR
2625
make node-v${NODE_VERSION}.tar.gz
27-
aws s3 cp --acl=public-read node-v${NODE_VERSION}.tar.gz ${S3_URL}${NAMEPATH}/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz
26+
aws s3 cp --acl=public-read node-v${NODE_VERSION}.tar.gz ${S3_URL}/v${NODE_VERSION}/node-v${NODE_VERSION}.tar.gz
2827

2928
cd $CWD

sign_node.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ set -e -u
2020
TMP=/tmp/v${NODE_VERSION}-signing
2121
mkdir -p ${TMP}/x64
2222

23+
if [ -n "$NAME" ]; then
24+
S3_URL="$S3_URL/$NAME"
25+
fi
26+
2327
# Download built node
2428
aws s3 cp ${S3_URL}/v${NODE_VERSION}/node.exe ${TMP}/
2529
aws s3 cp ${S3_URL}/v${NODE_VERSION}/x64/node.exe ${TMP}/x64/

update_shashums.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ if [[ ${S3_URL:-false} == false ]]; then
1010
exit 1
1111
fi
1212

13+
if [ -n "$NAME" ]; then
14+
S3_URL="$S3_URL/$NAME"
15+
fi
16+
1317
SCRATCH_DIR=/tmp/v${NODE_VERSION}-scratch
1418
mkdir -p ${SCRATCH_DIR}
1519
aws s3 cp --recursive ${S3_URL}/v${NODE_VERSION}/ ${SCRATCH_DIR}/

windows/build_node.bat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ IF ERRORLEVEL 1 GOTO ERROR
3333
SET ARCHPATH=
3434
IF %BUILDPLATFORM% EQU x64 (SET ARCHPATH="x64/")
3535

36-
SET NAMEPATH=
37-
IF "%NAME%" NEQ "" (SET NAMEPATH="/%NAME%")
36+
SET S3URL="s3://mapbox/node-cpp11"
37+
IF "%NAME%" NEQ "" (SET S3URL="%S3URL%/%NAME%")
3838

39-
call aws s3 cp --acl public-read %BUILD_TYPE%\node.exe s3://mapbox/node-cpp11%NAMEPATH%/v%NODE_VERSION%/%ARCHPATH%
39+
call aws s3 cp --acl public-read %BUILD_TYPE%\node.exe %S3URL%/v%NODE_VERSION%/%ARCHPATH%
4040
::IF ERRORLEVEL 1 GOTO ERROR
41-
call aws s3 cp --acl public-read %BUILD_TYPE%\node.lib s3://mapbox/node-cpp11%NAMEPATH%/v%NODE_VERSION%/%ARCHPATH%
41+
call aws s3 cp --acl public-read %BUILD_TYPE%\node.lib %S3URL%/v%NODE_VERSION%/%ARCHPATH%
4242
::IF ERRORLEVEL 1 GOTO ERROR
43-
call aws s3 cp --acl public-read %BUILD_TYPE%\node.exp s3://mapbox/node-cpp11%NAMEPATH%/v%NODE_VERSION%/%ARCHPATH%
43+
call aws s3 cp --acl public-read %BUILD_TYPE%\node.exp %S3URL%/v%NODE_VERSION%/%ARCHPATH%
4444
::IF ERRORLEVEL 1 GOTO ERROR
45-
call aws s3 cp --acl public-read %BUILD_TYPE%\node.pdb s3://mapbox/node-cpp11%NAMEPATH%/v%NODE_VERSION%/%ARCHPATH%
45+
call aws s3 cp --acl public-read %BUILD_TYPE%\node.pdb %S3URL%/v%NODE_VERSION%/%ARCHPATH%
4646
::IF ERRORLEVEL 1 GOTO ERROR
47-
call aws s3 cp --acl public-read %BUILD_TYPE%\openssl-cli.exe s3://mapbox/node-cpp11%NAMEPATH%/v%NODE_VERSION%/%ARCHPATH%
47+
call aws s3 cp --acl public-read %BUILD_TYPE%\openssl-cli.exe %S3URL%/v%NODE_VERSION%/%ARCHPATH%
4848
::IF ERRORLEVEL 1 GOTO ERROR
49-
call aws s3 cp --acl public-read %BUILD_TYPE%\openssl-cli.pdb s3://mapbox/node-cpp11%NAMEPATH%/v%NODE_VERSION%/%ARCHPATH%
49+
call aws s3 cp --acl public-read %BUILD_TYPE%\openssl-cli.pdb %S3URL%/v%NODE_VERSION%/%ARCHPATH%
5050
::IF ERRORLEVEL 1 GOTO ERROR
5151

5252
GOTO DONE

0 commit comments

Comments
 (0)