Retry nodeenv creation

We saw some failures while creating the nodeenv so add a retry there.

Change-Id: I97d65a31a4d1170e3aa2dae730e6e52e47780c82
This commit is contained in:
Tobias Henkel 2020-04-06 20:07:24 +02:00
parent 33fef37bc5
commit a0844c4b56
1 changed files with 9 additions and 1 deletions

View File

@ -23,7 +23,15 @@ then
pip install nodeenv pip install nodeenv
# Initialize nodeenv and tell it to re-use the currently active virtualenv # Initialize nodeenv and tell it to re-use the currently active virtualenv
# TODO(jeblair): remove node version pin. upath 1.0.4 objects to node >9. # TODO(jeblair): remove node version pin. upath 1.0.4 objects to node >9.
nodeenv --python-virtualenv -n 10.16.0 attempts=0
until nodeenv --python-virtualenv -n 10.16.0; do
((attempts++))
if [[ $attempts > 2 ]]
then
echo "Failed creating nodeenv"
exit 1
fi
done
# Use -g because inside of the virtualenv '-g' means 'install into the' # Use -g because inside of the virtualenv '-g' means 'install into the'
# virtualenv - as opposed to installing into the local node_modules. # virtualenv - as opposed to installing into the local node_modules.
# Avoid writing a package-lock.json file since we don't use it. # Avoid writing a package-lock.json file since we don't use it.