From: Aric Gardner Date: Mon, 16 Sep 2019 15:32:36 +0000 (-0400) Subject: pyenv pick latest installed version X-Git-Tag: v0.44.0~9 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F61739%2F4;hp=22e336c1e36a659855007ebaf7b0e479551520b0;p=releng%2Fglobal-jjb.git pyenv pick latest installed version Logic to pick latest version of pyev. Builders may have diffrent versions installed. Signed-off-by: Aric Gardner Change-Id: I2eb5cc75d815778bb35f166d1512711705b6ccd7 --- diff --git a/releasenotes/notes/pyenv-6d86242e2a8be6eb.yaml b/releasenotes/notes/pyenv-6d86242e2a8be6eb.yaml new file mode 100644 index 00000000..7d6bb561 --- /dev/null +++ b/releasenotes/notes/pyenv-6d86242e2a8be6eb.yaml @@ -0,0 +1,7 @@ +--- +fix: + - | + Builders may have diffrent pyenv versions installed. + Programically pick the latest pyenv version. + Since we change pyenv version when building images, we do not know which + pyenv version are avaliable. diff --git a/shell/check-info-votes.sh b/shell/check-info-votes.sh index 51ca172f..32384be4 100644 --- a/shell/check-info-votes.sh +++ b/shell/check-info-votes.sh @@ -25,7 +25,14 @@ if [ -d "/opt/pyenv" ]; then export PATH="$PYENV_ROOT/bin:$PATH" PYTHONPATH=$(pwd) export PYTHONPATH - pyenv local 3.6.4 + + latest_version=$(pyenv versions \ + | sed s,*,,g \ + | awk '/[0-9]+/{ print $1 }' \ + | sort --version-sort \ + | awk '/./{line=$0} END{print line}') + + pyenv local "$latest_version" export PYENV_VERSION="3.6.4" fi diff --git a/shell/release-job.sh b/shell/release-job.sh index 2ac368f6..c27a87f8 100644 --- a/shell/release-job.sh +++ b/shell/release-job.sh @@ -19,8 +19,16 @@ if [ -d "/opt/pyenv" ]; then fi PYTHONPATH=$(pwd) export PYTHONPATH -pyenv local 3.6.4 -export PYENV_VERSION="3.6.4" + +latest_version=$(pyenv versions \ + | sed s,*,,g \ + | awk '/[0-9]+/{ print $1 }' \ + | sort --version-sort \ + | awk '/./{line=$0} END{print line}') + +pyenv local "$latest_version" + +export PYENV_VERSION="$latest_version" pip install --user lftools[nexus] jsonschema niet yq #Functions.