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
This commit is contained in:
James E. Blair 2021-05-03 11:26:52 -07:00
parent f65982cf86
commit 1736ea8ca2
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -107,6 +107,7 @@ passenv =
OS_LOG_DEFAULTS
OS_STDERR_CAPTURE
OS_STDOUT_CAPTURE
YARN_REGISTRY
ZUUL_REMOTE_IPV4
ZUUL_SSH_KEY
ZUUL_TEST_ROOT