diff options
author | James E. Blair <jim@acmegating.com> | 2021-05-03 11:26:52 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2021-05-03 11:26:52 -0700 |
commit | 1736ea8ca213ddccf4f1b479efe7849b9064e7b7 (patch) | |
tree | 6265d4f4166199d5762fcdf4230f702a844f3364 /tools | |
parent | f65982cf867bb7dca785ddb48bc54c347e419487 (diff) | |
download | zuul-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-x | tools/pip.sh | 13 |
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 |