workaround transient npm failures (#4989)

This commit is contained in:
Alex Lam S.L
2021-05-30 10:19:29 +01:00
committed by GitHub
parent 06e3dbc089
commit f4f0d2a2dd
11 changed files with 95 additions and 21 deletions

View File

@@ -14,6 +14,13 @@ minify_in_situ() {
uglify-js $ARGS
}
npm_install() {
PKG="$1"
while !(npm install $PKG); do
while !(npm cache clean --force); do echo "'npm cache clean' failed - retrying..."; done
done
}
rm -rf tmp/bootstrap \
&& git clone --depth 1 --branch v5.0.0-beta2 https://github.com/twbs/bootstrap.git tmp/bootstrap \
&& cd tmp/bootstrap \
@@ -171,7 +178,7 @@ rm -rf tmp/bootstrap \
EOF
ERR=$?; if [ "$ERR" != "0" ]; then echo "Error: $ERR"; exit $ERR; fi
rm -rf node_modules \
&& npm ci \
&& npm_install \
&& minify_in_situ "node_modules/@popperjs/core" \
&& rm -rf dist/js/* \
&& minify_in_situ "build" \