Skip to content

Commit

Permalink
chore: retry docker run, instead of commands in build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanmar511 committed Jun 24, 2019
1 parent 138d5bd commit 34433c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions tools/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,17 @@ set -e pipefail
# Display commands
set -x

retry() {
"${@}" || "${@}" || "${@}" || exit $?
}

cd $(dirname $0)/../..
BASE_DIR=$PWD

ARTIFACTS_OUT="${BASE_DIR}/artifacts"
mkdir -p "$ARTIFACTS_OUT"

retry npm install
npm install

for version in 6.0.0 8.0.0 10.0.0 11.0.0 12.0.0
do
retry ./node_modules/.bin/node-pre-gyp configure rebuild package \
./node_modules/.bin/node-pre-gyp configure rebuild package \
--target=$version --target_arch="x64"
cp -r build/stage/* "${ARTIFACTS_OUT}/"
rm -rf build
Expand Down
4 changes: 2 additions & 2 deletions tools/build/linux_build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ cd $(dirname $0)/../..
BASE_DIR=$PWD

retry docker build -t build-linux -f tools/build/Dockerfile.linux tools/build
docker run -v "${BASE_DIR}":"${BASE_DIR}" build-linux \
retry docker run -v "${BASE_DIR}":"${BASE_DIR}" build-linux \
"${BASE_DIR}/tools/build/build.sh"

retry docker build -t build-alpine -f tools/build/Dockerfile.alpine tools/build
docker run -v "${BASE_DIR}":"${BASE_DIR}" build-alpine \
retry docker run -v "${BASE_DIR}":"${BASE_DIR}" build-alpine \
"${BASE_DIR}/tools/build/build.sh"

GCS_LOCATION="cprof-e2e-nodejs-artifacts/pprof-nodejs/kokoro/${BUILD_TYPE}/${KOKORO_BUILD_NUMBER}"
Expand Down

0 comments on commit 34433c5

Please sign in to comment.