From fd580eab977e4c528427a1bbd54b2fd3d3a1ad77 Mon Sep 17 00:00:00 2001 From: Stuart Young Date: Mon, 17 Sep 2018 14:15:02 -0400 Subject: [PATCH] load cached npm cache on jenkins workers --- scripts/jenkins-common.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/jenkins-common.sh b/scripts/jenkins-common.sh index 4b4c23b3f5..cf91207221 100644 --- a/scripts/jenkins-common.sh +++ b/scripts/jenkins-common.sh @@ -26,6 +26,16 @@ if [ -e $HOME/edx-venv_clean.tar.gz ]; then tar -C $HOME -xf $HOME/edx-venv_clean.tar.gz fi +# Load the npm packages from the time the worker was built +# into the npm cache. This is an attempt to reduce the number +# of times that npm gets stuck during an installation, by +# reducing the number of packages that npm needs to fetch. +if [ -e $HOME/edx-npm-cache_clean.tar.gz ]; then + echo "Loading archived npm packages into the local npm cache" + rm -rf $HOME/.npm + tar -C $HOME -xf $HOME/edx-npm-cache_clean.tar.gz +fi + # Activate the Python virtualenv source $HOME/edx-venv/bin/activate