mvn-settings: "{mvn-settings}"
mvn-version: mvn35
pre-build-script: "# pre-build script goes here"
- python-version: python2
+ python-version: python3
sonar-mvn-goal: "sonar:sonar"
stream: master
submodule-recursive: true
github-url: "https://github.com"
parallel: true
pre-build-script: "# pre-build script goes here"
- python-version: python2
+ python-version: python3
stream: master
submodule-recursive: true
submodule-timeout: 10
pip_list_post=/tmp/pip-list-post.txt
pip_list_diffs=/tmp/pip-list-diffs.txt
if [[ -f $pip_list_pre ]]; then
- pip list > $pip_list_post
+ python3 -m pip list > $pip_list_post
echo "Compare pip packages before/after..."
if diff --suppress-common-lines $pip_list_pre $pip_list_post \
| tee $pip_list_diffs; then
# log-deploy.sh script is 'appended' to this file and it would not
# be executed.
else
- pip list > "$pip_list_pre"
+ python3 -m pip list > "$pip_list_pre"
# These 'pip installs' only need to be executed during pre-build
requirements_file=$(mktemp /tmp/requirements-XXXX.txt)
echo "Generating Requirements File"
cat << 'EOF' > "$requirements_file"
-lftools[openstack]~=0.26.2
-python-cinderclient~=4.3.0
-python-heatclient~=1.16.1
-python-openstackclient~=3.16.0
-dogpile.cache~=0.6.8 # Version 0.7.[01] seems to break openstackclient
-more-itertools~=5.0.0
-niet~=1.4.2 # Extract values from yaml
-tox>=3.7.0. # Tox 3.7 or greater is necessary for parallel mode support
-yq~=2.7.2
+lftools[openstack]
+python-heatclient
+python-openstackclient
+niet~=1.4.2
+tox>=3.7.0 # Tox 3.7 or greater is necessary for parallel mode support
+yq
EOF
# Use `python -m pip` to ensure we are using the latest version of pip
- python -m pip install --user --quiet --upgrade pip
- python -m pip install --user --quiet --upgrade setuptools
- python -m pip install --user --quiet --upgrade -r "$requirements_file"
+ python3 -m venv ~/.local
+ python3 -m pip install --user --quiet --upgrade pip
+ python3 -m pip install --user --quiet --upgrade setuptools
+ python3 -m pip install --user --quiet --upgrade -r "$requirements_file"
rm -rf "$requirements_file"
fi
echo "---> release-job.sh"
set -eu -o pipefail
-#Python bits. Remove when centos 7.7 builder is avaliable.
-if [ -d "/opt/pyenv" ]; then
- echo "INFO: Setting up pyenv"
- export PYENV_ROOT="/opt/pyenv"
- export PATH="$PYENV_ROOT/bin:$PATH"
-fi
-PYTHONPATH=$(pwd)
-export PYTHONPATH
-
-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
+set +u
+python3 -m venv /tmp/v/venv/
+# shellcheck disable=SC1091
+source /tmp/v/venv/bin/activate
+set -u
+python -m pip install lftools[nexus] jsonschema niet yq
#Functions.
##############################################################################
echo "---> tox-run.sh"
-# 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
-
ARCHIVE_TOX_DIR="$WORKSPACE/archives/tox"
mkdir -p "$ARCHIVE_TOX_DIR"
-cd "$WORKSPACE/$TOX_DIR"
+cd "$WORKSPACE/$TOX_DIR" || exit 1
if [ -d "/opt/pyenv" ]; then
echo "---> Setting up pyenv"
export PYENV_ROOT="/opt/pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
+ PYTHONPATH="$(pwd)"
+ export PYTHONPATH
+ export TOX_TESTENV_PASSENV=PYTHONPATH
fi
-# Set and pass in PYTHONPATH to circumvent installation bug in tox>=3.2.0
-PYTHONPATH=$(pwd)
-export PYTHONPATH
-export TOX_TESTENV_PASSENV=PYTHONPATH
-
-set +e # Allow detox to fail so that we can collect the logs in the next step
-
PARALLEL="${PARALLEL:-true}"
if [ "${PARALLEL}" = true ]; then
if [ -n "$TOX_ENVS" ]; then
tox_env=$(echo "$i" | awk -F'/' '{print $2}')
cp -r "$i" "$ARCHIVE_TOX_DIR/$tox_env"
done
-set -e # Logs collected so re-enable
echo "Completed tox runs."