8 {project-name}-python-jobs
9 --------------------------
11 Jobs for Python projects using Gerrit.
17 {project-name}-github-python-jobs
18 ---------------------------------
20 Jobs for Python projects using GitHub.
33 Runs a shell script that installs tox in a Python virtualenv.
37 :python-version: Base Python version to use in the virtualenv. For example
47 Sonar scans for Python based repos. This job will perform a tox call which
48 runs the coverage command to gather tests results. These test results get
49 published back into Sonar after running the Sonar goals.
51 To get the Sonar coverage results, tox.ini needs to exist and configured
52 with coverage commands to run.
54 The coverage commands define the code that gets executed by the test suites.
55 It does not guarantee that the code tests executed properly, but it will help
56 pointing out the code that is not tested at all.
64 coverage run --module pytest --junitxml xunit-results.xml
65 coverage xml --omit=".tox/py27/*","tests/*"
66 coverage report --omit=".tox/py27/*","tests/*"
68 For more details refer to coverage and sonar documentation:
70 https://coverage.readthedocs.io/
72 https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import
76 - {project-name}-tox-sonar
82 :build-node: The node to run build on.
83 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
84 get configured in defaults.yaml)
85 :mvn-settings: The name of settings file containing credentials for the project.
89 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
90 :build-timeout: Timeout in seconds before aborting build. (default: 60)
91 :cron: Cron schedule when to trigger the job. This parameter also
92 supports multiline input via YAML pipe | character in cases where
93 one may want to provide more than 1 cron timer. (default: H 11 * * *
95 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
96 :java-version: Version of Java to use for the build. (default: openjdk8)
97 :mvn-global-settings: The name of the Maven global settings to use for
98 Maven configuration. (default: global-settings)
99 :mvn-version: Version of maven to use. (default: mvn33)
100 :stream: Keyword used to represent a release code-name.
101 Often the same as the branch. (default: master)
102 :submodule-recursive: Whether to checkout submodules recursively.
104 :gerrit_sonar_triggers: Override Gerrit Triggers.
109 Tox runner to verify a project. This job is pyenv aware so if the image
110 contains an installation of pyenv at /opt/pyenv it will pick it up and run
111 Python tests with the appropriate Python versions. This job will set the
112 following pyenv variables before running.
116 export PYENV_ROOT="/opt/pyenv"
117 export PATH="$PYENV_ROOT/bin:$PATH"
121 - {project-name}-tox-verify-{stream}
125 :Required Parameters:
127 :build-node: The node to run build on.
128 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
131 :Optional Parameters:
133 :branch: The branch to build against. (default: master)
134 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
135 :build-timeout: Timeout in seconds before aborting build. (default: 10)
136 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
137 :python-version: Version of Python to configure as a base in virtualenv.
139 :stream: Keyword representing a release code-name.
140 Often the same as the branch. (default: master)
141 :submodule-recursive: Whether to checkout submodules recursively.
143 :tox-dir: Directory containing the project's tox.ini relative to
144 the workspace. Empty works if tox.ini is at project root.
146 :tox-envs: Tox environments to run. If blank run everything described
147 in tox.ini. (default: '')