X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb-test%2Fexpected-xml%2Fgerrit-python-tox-verify-master;h=885d5a27daf8740cb8d6491b16ee4dd0ed7a30d4;hb=fb9abdc112c25dc88c43fc094d0dd4a99385a211;hp=30fa7f18b9431e91470b7dbbaf4fc4b95d6d7866;hpb=ec0a666af4481b21b82be836011d6c94bb04e098;p=releng%2Fglobal-jjb.git diff --git a/jjb-test/expected-xml/gerrit-python-tox-verify-master b/jjb-test/expected-xml/gerrit-python-tox-verify-master index 30fa7f18..885d5a27 100644 --- a/jjb-test/expected-xml/gerrit-python-tox-verify-master +++ b/jjb-test/expected-xml/gerrit-python-tox-verify-master @@ -64,6 +64,15 @@ job is triggered by Gerrit. refs/heads/master + + LFTOOLS_VERSION + Version of lftools to install. Can be a specific version like +'0.6.0' or a PEP-440 definition. +https://www.python.org/dev/peps/pep-0440/ +For example '<1.0.0' or '>=1.0.0,<2.0.0'. + + <1.0.0 + TOX_DIR Path to directory containing tox.ini file. @@ -190,6 +199,39 @@ Example: docs,py2,py3 ############################################################################## echo "---> lftools-install.sh" +# Script to install lftools via a version passed in via lf-infra-parameters +# +# Required parameters: +# +# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be +# set to a strict version number like '1.2.3' or using +# PEP-440 definitions. +# +# Examples: +# <1.0.0 +# >=1.0.0,<2.0.0 +# +# By default a released version of lftools should always be used. +# The purpose of the 2 variables below is so that lftools devs can test +# unreleased versions of lftools. There are 2 methods to install a dev version +# of lftools: +# +# 1) gerrit patch: Used to test a patch that has not yet been merged. +# To do this set something like this: +# LFTOOLS_MODE=gerrit +# LFTOOLS_REFSPEC=refs/changes/96/5296/7 +# +# 2) git branch: Used to install an lftools version from a specific branch. +# To use this set the variables as follows: +# LFTOOLS_MODE=git +# LFTOOLS_REFSPEC=master +# +# 3) release : The intended use case and default setting. +# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. + +LFTOOLS_MODE=release # release | git | gerrit +LFTOOLS_REFSPEC=master + # Ensure we fail the job if any steps fail. # DO NOT set -u as virtualenv's activate script has unbound variables set -e -o pipefail @@ -198,7 +240,32 @@ virtualenv --quiet "/tmp/v/lftools" # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 source "/tmp/v/lftools/bin/activate" pip install --quiet --upgrade pip -pip install --quiet --upgrade "lftools<1.0.0" + +case $LFTOOLS_MODE in + gerrit) + git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools + pushd /tmp/lftools + git fetch origin "$LFTOOLS_REFSPEC" + git checkout FETCH_HEAD + pip install --quiet --upgrade -r requirements.txt + pip install --quiet --upgrade -e . + popd + ;; + + git) + pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" + ;; + + release) + if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then + LFTOOLS_VERSION="==$LFTOOLS_VERSION" + fi + + pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" + ;; +esac + +lftools --version # pipdeptree prints out a lot of information because lftools pulls in many # dependencies. Let's only print it if we want to debug. @@ -366,6 +433,39 @@ echo "machine $machine login $user password $pass" > ~/.netrc ############################################################################## echo "---> lftools-install.sh" +# Script to install lftools via a version passed in via lf-infra-parameters +# +# Required parameters: +# +# LFTOOLS_VERSION: Passed in via lf-infra-parameters configuration. Can be +# set to a strict version number like '1.2.3' or using +# PEP-440 definitions. +# +# Examples: +# <1.0.0 +# >=1.0.0,<2.0.0 +# +# By default a released version of lftools should always be used. +# The purpose of the 2 variables below is so that lftools devs can test +# unreleased versions of lftools. There are 2 methods to install a dev version +# of lftools: +# +# 1) gerrit patch: Used to test a patch that has not yet been merged. +# To do this set something like this: +# LFTOOLS_MODE=gerrit +# LFTOOLS_REFSPEC=refs/changes/96/5296/7 +# +# 2) git branch: Used to install an lftools version from a specific branch. +# To use this set the variables as follows: +# LFTOOLS_MODE=git +# LFTOOLS_REFSPEC=master +# +# 3) release : The intended use case and default setting. +# Set LFTOOLS_MODE=release, in this case LFTOOLS_REFSPEC is unused. + +LFTOOLS_MODE=release # release | git | gerrit +LFTOOLS_REFSPEC=master + # Ensure we fail the job if any steps fail. # DO NOT set -u as virtualenv's activate script has unbound variables set -e -o pipefail @@ -374,7 +474,32 @@ virtualenv --quiet "/tmp/v/lftools" # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 source "/tmp/v/lftools/bin/activate" pip install --quiet --upgrade pip -pip install --quiet --upgrade "lftools<1.0.0" + +case $LFTOOLS_MODE in + gerrit) + git clone https://gerrit.linuxfoundation.org/infra/releng/lftools.git /tmp/lftools + pushd /tmp/lftools + git fetch origin "$LFTOOLS_REFSPEC" + git checkout FETCH_HEAD + pip install --quiet --upgrade -r requirements.txt + pip install --quiet --upgrade -e . + popd + ;; + + git) + pip install --quiet --upgrade git+https://gerrit.linuxfoundation.org/infra/releng/lftools.git@"$BRANCH" + ;; + + release) + if [[ $LFTOOLS_VERSION =~ ^[0-9] ]]; then + LFTOOLS_VERSION="==$LFTOOLS_VERSION" + fi + + pip install --quiet --upgrade "lftools${LFTOOLS_VERSION}" + ;; +esac + +lftools --version # pipdeptree prints out a lot of information because lftools pulls in many # dependencies. Let's only print it if we want to debug.