From b3556ba2ee6b4617846846e66fb4275bd340aebd Mon Sep 17 00:00:00 2001 From: Stu Young Date: Mon, 19 Aug 2019 12:55:58 -0400 Subject: [PATCH] use archived venv on jenkins (#21378) --- scripts/jenkins-common.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/jenkins-common.sh b/scripts/jenkins-common.sh index f5ca9b5a81..c9c44ed40e 100644 --- a/scripts/jenkins-common.sh +++ b/scripts/jenkins-common.sh @@ -24,9 +24,15 @@ fi # Reset the jenkins worker's virtualenv back to the # state it was in when the instance was spun up. -if [ -e $HOME/edx-venv_clean.tar.gz ]; then +if [ -z ${PYTHON_VERSION+x} ] || [[ ${PYTHON_VERSION} == 'null' ]]; then + ARCHIVED_VENV="edx-venv_clean.tar.gz" +else + ARCHIVED_VENV="edx-venv_clean-$PYTHON_VERSION.tar.gz" +fi + +if [ -e $HOME/$ARCHIVED_VENV ]; then rm -rf $HOME/edx-venv - tar -C $HOME -xf $HOME/edx-venv_clean.tar.gz + tar -C $HOME -xf $HOME/$ARCHIVED_VENV fi # Load the npm packages from the time the worker was built