From ea3316fdbaedc16af08219a10eba9a83269e51b7 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 17 Apr 2018 14:50:55 +0100 Subject: xci: infra: bifrost: Use XCI virtual environment for bifrost We have already prepared a virtual environment for XCI so we may as well use it for bifrost as well. Change-Id: I084e5da7259a392c5d58e62e7985feb75bb45fb2 Signed-off-by: Markos Chandras --- xci/infra/bifrost/scripts/bifrost-provision.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'xci/infra') diff --git a/xci/infra/bifrost/scripts/bifrost-provision.sh b/xci/infra/bifrost/scripts/bifrost-provision.sh index f653a2fd..940e9439 100755 --- a/xci/infra/bifrost/scripts/bifrost-provision.sh +++ b/xci/infra/bifrost/scripts/bifrost-provision.sh @@ -21,7 +21,7 @@ export PYTHONUNBUFFERED=1 SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)" BIFROST_HOME=$SCRIPT_HOME/.. ENABLE_VENV="true" -export VENV=${XCI_VENV}/bifrost +export VENV=${XCI_VENV} PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} # This is normally exported by XCI env but we should initialize it here # in case we run this script on its own for debug purposes @@ -102,7 +102,15 @@ fi # Install missing dependencies. Use sudo since for bifrost jobs # the venv is not ready yet. -[[ -n ${VIRTUAL_ENV:-} ]] && _sudo="" || _sudo="sudo -H -E" +if [[ -n ${VIRTUAL_ENV:-} ]]; then + _sudo="" +else + virtualenv --quiet --no-site-packages ${XCI_VENV} + set +u + source ${XCI_VENV}/bin/activate + set -u + _sudo="sudo -H -E" +fi ${_sudo} pip install -q --upgrade -r "$(dirname $0)/../requirements.txt" # Change working directory -- cgit 1.2.3-korg