Browse Source

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
changes/01/789401/1
James E. Blair 1 week ago
parent
commit
1736ea8ca2
2 changed files with 13 additions and 1 deletions
  1. +12
    -1
      tools/pip.sh
  2. +1
    -0
      tox.ini

+ 12
- 1
tools/pip.sh 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


+ 1
- 0
tox.ini 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


Loading…
Cancel
Save