summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2021-05-03 11:26:52 -0700
committerJames E. Blair <jim@acmegating.com>2021-05-03 11:26:52 -0700
commit1736ea8ca213ddccf4f1b479efe7849b9064e7b7 (patch)
tree6265d4f4166199d5762fcdf4230f702a844f3364 /tools
parentf65982cf867bb7dca785ddb48bc54c347e419487 (diff)
downloadzuul-1736ea8ca213ddccf4f1b479efe7849b9064e7b7.tar.gz
Retry yarn package installs
We're seeing occasional npm install failures in jobs; retry the "yarn install" command if it fails. Also, pass the YARN_REGISTRY env var in the tox remote job. Change-Id: Ic80dccf0869ce805368f678eafcfdf48f8bf9bea
Diffstat (limited to 'tools')
-rwxr-xr-xtools/pip.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/pip.sh b/tools/pip.sh
index 914c7ffe7..ddcc12d26 100755
--- a/tools/pip.sh
+++ b/tools/pip.sh
@@ -47,7 +47,18 @@ then
echo "Using yarn registry: ${YARN_REGISTRY}"
sed -i "s#https://registry.yarnpkg.com#${YARN_REGISTRY}#" yarn.lock
fi
- yarn install --verbose
+
+ # Be forgiving of package retrieval errors
+ attempts=0
+ until yarn install --verbose; do
+ ((attempts++))
+ if [[ $attempts > 2 ]]
+ then
+ echo "Failed installing npm packages"
+ exit 1
+ fi
+ done
+
yarn build
if [[ -n "${YARN_REGISTRY}" ]]
then