summaryrefslogtreecommitdiffstats
path: root/xci/infra
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-04-17 14:50:55 +0100
committerMarkos Chandras <mchandras@suse.de>2018-04-17 16:57:26 +0000
commitea3316fdbaedc16af08219a10eba9a83269e51b7 (patch)
tree97a11e184a0031e3f0e9152a600284b599548b81 /xci/infra
parenta7731d320ffc368b67c48c7f4d3f0f318c735e19 (diff)
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 <mchandras@suse.de>
Diffstat (limited to 'xci/infra')
-rwxr-xr-xxci/infra/bifrost/scripts/bifrost-provision.sh12
1 files changed, 10 insertions, 2 deletions
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