Enable pyenv if available in image 70/8370/2
authorThanh Ha <thanh.ha@linuxfoundation.org>
Thu, 11 Jan 2018 23:27:16 +0000 (18:27 -0500)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Fri, 12 Jan 2018 03:49:25 +0000 (22:49 -0500)
We need pyenv so that tox can pull in Python versions provided by
the pyenv setup.

Issue: RT-50802
Change-Id: I406f28e10e2d701f5f8fd396fea10d81bffd61a8
Co-authored-by: Vanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
.jjb-test/expected-xml/gerrit-python-tox-verify-master
.jjb-test/expected-xml/github-python-tox-verify-master
shell/tox-run.sh

index aaaaa4d..c1d4956 100644 (file)
@@ -319,9 +319,14 @@ set -e -o pipefail
 
 ARCHIVE_TOX_DIR=&quot;$WORKSPACE/archives/tox&quot;
 mkdir -p &quot;$ARCHIVE_TOX_DIR&quot;
-
 cd &quot;$WORKSPACE/$TOX_DIR&quot;
 
+if [ -d &quot;/opt/pyenv&quot; ]; then
+    echo &quot;---&gt; Setting up pyenv&quot;
+    export PYENV_ROOT=&quot;/opt/pyenv&quot;
+    export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;
+fi
+
 if [ ! -z &quot;$TOX_ENVS&quot; ]; then
     detox -e &quot;$TOX_ENVS&quot;  | tee -a &quot;$ARCHIVE_TOX_DIR/detox.log&quot;
 else
index 7081949..d04f71e 100644 (file)
@@ -281,9 +281,14 @@ set -e -o pipefail
 
 ARCHIVE_TOX_DIR=&quot;$WORKSPACE/archives/tox&quot;
 mkdir -p &quot;$ARCHIVE_TOX_DIR&quot;
-
 cd &quot;$WORKSPACE/$TOX_DIR&quot;
 
+if [ -d &quot;/opt/pyenv&quot; ]; then
+    echo &quot;---&gt; Setting up pyenv&quot;
+    export PYENV_ROOT=&quot;/opt/pyenv&quot;
+    export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;
+fi
+
 if [ ! -z &quot;$TOX_ENVS&quot; ]; then
     detox -e &quot;$TOX_ENVS&quot;  | tee -a &quot;$ARCHIVE_TOX_DIR/detox.log&quot;
 else
index 97f8855..0eae0f1 100644 (file)
@@ -16,9 +16,14 @@ set -e -o pipefail
 
 ARCHIVE_TOX_DIR="$WORKSPACE/archives/tox"
 mkdir -p "$ARCHIVE_TOX_DIR"
-
 cd "$WORKSPACE/$TOX_DIR"
 
+if [ -d "/opt/pyenv" ]; then
+    echo "---> Setting up pyenv"
+    export PYENV_ROOT="/opt/pyenv"
+    export PATH="$PYENV_ROOT/bin:$PATH"
+fi
+
 if [ ! -z "$TOX_ENVS" ]; then
     detox -e "$TOX_ENVS"  | tee -a "$ARCHIVE_TOX_DIR/detox.log"
 else