# pipdeptree
</command>
</hudson.tasks.Shell>
+ <EnvInjectBuilder>
+ <info>
+ <propertiesContent>PYTHON_VERSION=python3</propertiesContent>
+ </info>
+ </EnvInjectBuilder>
<hudson.tasks.Shell>
<command>#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
# DO NOT set -u as virtualenv's activate script has unbound variables
set -e -o pipefail
-virtualenv --quiet "/tmp/v/tox"
+virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox"
# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
source "/tmp/v/tox/bin/activate"
pip install --quiet --upgrade pip
echo "----> Pip Dependency Tree"
pipdeptree
-
-#!/bin/bash
+</command>
+ </hudson.tasks.Shell>
+ <hudson.tasks.Shell>
+ <command>#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
##############################################################################
echo "---> tox-run.sh"
+# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
+source "/tmp/v/tox/bin/activate"
+
# 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
# DO NOT set -u as virtualenv's activate script has unbound variables
set -e -o pipefail
-virtualenv --quiet "/tmp/v/tox"
+virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox"
# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
source "/tmp/v/tox/bin/activate"
pip install --quiet --upgrade pip
# pipdeptree
</command>
</hudson.tasks.Shell>
+ <EnvInjectBuilder>
+ <info>
+ <propertiesContent>PYTHON_VERSION=python3</propertiesContent>
+ </info>
+ </EnvInjectBuilder>
<hudson.tasks.Shell>
<command>#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
# DO NOT set -u as virtualenv's activate script has unbound variables
set -e -o pipefail
-virtualenv --quiet "/tmp/v/tox"
+virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox"
# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
source "/tmp/v/tox/bin/activate"
pip install --quiet --upgrade pip
echo "----> Pip Dependency Tree"
pipdeptree
-
-#!/bin/bash
+</command>
+ </hudson.tasks.Shell>
+ <hudson.tasks.Shell>
+ <command>#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
##############################################################################
echo "---> tox-run.sh"
+# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
+source "/tmp/v/tox/bin/activate"
+
# 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
# DO NOT set -u as virtualenv's activate script has unbound variables
set -e -o pipefail
-virtualenv --quiet "/tmp/v/tox"
+virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox"
# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
source "/tmp/v/tox/bin/activate"
pip install --quiet --upgrade pip
- github-tox-verify
+
+Macros
+======
+
+lf-tox-install
+--------------
+
+Runs a shell script that installs tox in a Python virtualenv.
+
+:Required Parameters:
+
+ :python-version: Base Python version to use in the virtualenv. For example
+ python2 or python3.
+
+
Job Templates
=============
:build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
:build-timeout: Timeout in seconds before aborting build. (default: 10)
:git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
+ :python-version: Version of Python to configure as a base in virtualenv.
+ (default: python3)
:stream: Keyword representing a release code-name.
Often the same as the branch. (default: master)
:submodule-recursive: Whether to checkout submodules recursively.
jobs:
- github-tox-verify
+##########
+# Macros #
+##########
+
+- builder:
+ name: lf-infra-tox-install
+ builders:
+ - inject:
+ properties-content: 'PYTHON_VERSION={python-version}'
+ - shell: !include-raw-escape: ../shell/tox-install.sh
+
##############
# Tox Verify #
##############
build-days-to-keep: 7
build-timeout: 10
git-url: '$GIT_URL/$GERRIT_PROJECT'
+ python-version: python3
stream: master
submodule-recursive: true
tox-dir: ''
# Without running the install first the run in the publisher will fail
# due to missing lftools because it gets installed into a tox venv.
- ../shell/lftools-install.sh
- - shell: !include-raw-escape:
- - ../shell/tox-install.sh
- - ../shell/tox-run.sh
+ - lf-infra-tox-install:
+ python-version: '{python-version}'
+ - shell: !include-raw-escape: ../shell/tox-run.sh
publishers:
- lf-infra-publish
# DO NOT set -u as virtualenv's activate script has unbound variables
set -e -o pipefail
-virtualenv --quiet "/tmp/v/tox"
+virtualenv --quiet -p "$PYTHON_VERSION" "/tmp/v/tox"
# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
source "/tmp/v/tox/bin/activate"
pip install --quiet --upgrade pip
##############################################################################
echo "---> tox-run.sh"
+# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
+source "/tmp/v/tox/bin/activate"
+
# 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