Skip to content

Commit

Permalink
Adding JOBS environment variable to speed builds up, and reducing sco…
Browse files Browse the repository at this point in the history
…pe of Alpine Linux builds.
  • Loading branch information
nicolasnoble committed Mar 13, 2018
1 parent 8857cca commit fcf472e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cd $tool_dir/../../..
base_dir=$(pwd)

export ARTIFACTS_OUT=$base_dir/artifacts
export JOBS=8

rm -rf build || true

Expand All @@ -32,4 +33,4 @@ $tool_dir/build_artifact_node.sh

$tool_dir/build_artifact_node_arm.sh

docker run -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact bash -c /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine
docker run -e JOBS=8 -e ARTIFACTS_OUT=/var/grpc/artifacts -v $base_dir:/var/grpc alpine_node_artifact /var/grpc/tools/run_tests/artifacts/build_artifact_node.sh --with-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ set electron_versions=1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0

set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm

set JOBS=8

del /f /q BUILD || rmdir build /s /q

call npm update || goto :error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@

set -ex

NODE_ALPINE_BUILD=false
arch_list=( ia32 x64 )
node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 9.0.0 )
electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 )

while true ; do
case $1 in
--with-alpine)
NODE_ALPINE_BUILD=true
arch_list=( x64 )
electron_versions=( )
;;
"")
;;
Expand All @@ -33,8 +36,6 @@ while true ; do
shift || break
done

NODE_ALPINE_BUILD=$1

umask 022

cd $(dirname $0)/../../..
Expand All @@ -45,17 +46,11 @@ mkdir -p "${ARTIFACTS_OUT}"

npm update

arch_list=( ia32 x64 )

node_versions=( 4.0.0 5.0.0 6.0.0 7.0.0 8.0.0 9.0.0 )

electron_versions=( 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.7.0 )

for arch in ${arch_list[@]}
do
for version in ${node_versions[@]}
do
./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$arch --grpc_alpine=$NODE_ALPINE_BUILD
./node_modules/.bin/node-pre-gyp configure rebuild package --target=$version --target_arch=$arch
cp -r build/stage/* "${ARTIFACTS_OUT}"/
done

Expand Down
1 change: 1 addition & 0 deletions run-tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ PowerShell -Command .\install-nvm-windows.ps1
SET NVM_HOME=%ROOT%nvm
SET NVM_SYMLINK=%ROOT%nvm\nodejs
SET PATH=%NVM_HOME%;%NVM_SYMLINK%;%PATH%
SET JOBS=8

nvm version

Expand Down
1 change: 1 addition & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set -ex
npm install --unsafe-perm

mkdir -p reports
export JOBS=8

# TODO(mlumish): Add electron tests

Expand Down
2 changes: 1 addition & 1 deletion tools/release/kokoro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ Linux)
mv packages/grpc-native-core/artifacts .
;;
Darwin)
ARTIFACTS_OUT=$base_dir/artifacts ./packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh
JOBS=8 ARTIFACTS_OUT=$base_dir/artifacts ./packages/grpc-native-core/tools/run_tests/artifacts/build_artifact_node.sh
;;
esac

0 comments on commit fcf472e

Please sign in to comment.