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 3 months ago
parent
commit
1736ea8ca2
  1. 13
      tools/pip.sh
  2. 1
      tox.ini

13
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

1
tox.ini

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