X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-install.sh;h=86fbef71f7975cb4c90d21fc1b8432be1ce9e815;hb=6eefde1f463638b5021c2ec96eb67a017d379f1f;hp=6eea3adf01288e7b57bab4c89ca19a98e833fe2f;hpb=0cd4f5d8c5fc52e167cd19ab00bddec4f7f0c190;p=releng%2Fglobal-jjb.git diff --git a/shell/jjb-install.sh b/shell/jjb-install.sh index 6eea3adf..86fbef71 100644 --- a/shell/jjb-install.sh +++ b/shell/jjb-install.sh @@ -1,5 +1,5 @@ #!/bin/bash -# @License EPL-1.0 +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. # @@ -11,11 +11,19 @@ echo "---> jjb-install.sh" # Ensure we fail the job if any steps fail. -set -eu -o pipefail +# DO NOT set -u as virtualenv's activate script has unbound variables +set -e -o pipefail -virtualenv "$WORKSPACE/.virtualenvs/jjb" -# shellcheck source=./.virtualenvs/jjb/bin/activate disable=SC1091 -source "$WORKSPACE/.virtualenvs/jjb/bin/activate" -pip install --upgrade pip -pip install --upgrade "jenkins-job-builder==$JJB_VERSION" +# Create a virtualenv in a temporary directoy and write it down to used +# or cleaned up later; cleanup is done in the script jjb-cleanup.sh. +JJB_VENV="$(mktemp -d)" +export JJB_VENV +virtualenv "$JJB_VENV" +echo "JJB_VENV=$JJB_VENV" > "$WORKSPACE/.jjb.properties" +# shellcheck source=$VENV_DIR/bin/activate disable=SC1091 +source "$JJB_VENV/bin/activate" +pip install --quiet --upgrade "pip==9.0.3" setuptools +pip install --quiet --upgrade "jenkins-job-builder==$JJB_VERSION" + +echo "----> pip freeze" pip freeze