jjb: Move to python3
[infra/cicd.git] / jjb / infra / jjb-verify.sh
index 9c74acf0c4dad9e818db1c83fb1bf919da88b57f..8389ae3d63c88aa5d719abe5b13eeb6501a5abe2 100755 (executable)
@@ -3,6 +3,11 @@ set -o errexit
 set -o nounset
 set -o pipefail
 
+# install required packages
+sudo apt update > /dev/null 2>&1
+sudo apt install -y -q=3 gcc libffi-dev libssl-dev lsb-release libpython3-dev \
+    python3-minimal python3-pip python3-yaml virtualenv
+
 # workaround for https://github.com/pypa/virtualenv/issues/1029
 export PS1=${PS1:-}
 
@@ -10,7 +15,7 @@ cd $WORKSPACE
 echo "Info: Installing OpenStack Jenkins Job Builder (JJB) version $JJB_VERSION from source in venv"
 echo "----------------------------------------------------"
 git clone -q $JJB_GIT_REPO -b $JJB_VERSION > /dev/null 2>&1
-virtualenv .venv -q
+virtualenv -p python3 --quiet --no-site-packages .venv
 source .venv/bin/activate
 cd jenkins-job-builder && pip install -q -r test-requirements.txt -e .
 echo "Info: Installed JJB"