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 Run CLM scanning against a Python project.
37 :clm-project-name: Project name in Nexus IQ to send results to.
42 Install Tox into a virtualenv.
46 :python-version: Version of Python to install into the Tox virtualenv.
52 Runs Sonar scanning against a Python project.
56 :java-version: Version of Java to use to run Sonar.
57 :mvn-version: Version of Maven to use to run Sonar.
62 Runs a shell script that installs tox in a Python virtualenv.
66 :python-version: Base Python version to use in the virtualenv. For example
76 CLM scans for Python based repos. This job will call the Nexus IQ CLI
77 directly to run the scans.
79 A new credential named "nexus-iq-xc-clm" needs to exist in the Jenkins credentials.
80 The credential should contain the username and password to access Nexus
85 - {project-name}-python-clm-{stream}
86 - gerrit-python-xc-clm
87 - github-python-xc-clm
89 :Comment Trigger: run-clm
93 :build-node: The node to run build on.
94 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
95 get configured in defaults.yaml)
99 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
100 :nexus-iq-cli-version: Nexus IQ CLI package version to download and use. (default: 1.44.0-01)
101 :build-timeout: Timeout in minutes before aborting build. (default: 60)
102 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
103 :java-version: Version of Java to use for the build. (default: openjdk8)
104 :stream: Keyword used to represent a release code-name.
105 Often the same as the branch. (default: master)
106 :submodule-recursive: Whether to checkout submodules recursively.
108 :gerrit_clm_triggers: Override Gerrit Triggers.
109 :gerrit_trigger_file_paths: Override file paths which used to filter which
110 file modifications will trigger a build. Refer to JJB documentation for
112 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
115 Python Sonar with Tox
116 ---------------------
118 Sonar scans for Python based repos. This job will perform a tox call which
119 runs the coverage command to gather tests results. These test results get
120 published back into Sonar after running the Sonar goals.
122 To get the Sonar coverage results, tox.ini needs to exist and configured
123 with coverage commands to run.
125 The coverage commands define the code that gets executed by the test suites.
126 It does not guarantee that the code tests executed properly, but it will help
127 pointing out the code that is not tested at all.
135 coverage run --module pytest --junitxml xunit-results.xml
136 coverage xml --omit=".tox/py27/*","tests/*"
137 coverage report --omit=".tox/py27/*","tests/*"
139 For more details refer to coverage and sonar documentation:
141 https://coverage.readthedocs.io/
143 https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import
147 - {project-name}-tox-sonar
151 :Comment Trigger: run-sonar
153 :Required parameters:
155 :build-node: The node to run build on.
156 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
157 get configured in defaults.yaml)
158 :mvn-settings: The name of settings file containing credentials for the project.
160 :Optional parameters:
162 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
163 :build-timeout: Timeout in minutes before aborting build. (default: 60)
164 :cron: Cron schedule when to trigger the job. This parameter also
165 supports multiline input via YAML pipe | character in cases where
166 one may want to provide more than 1 cron timer. (default: H 11 * * *
168 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
169 :java-version: Version of Java to use for the build. (default: openjdk8)
170 :mvn-global-settings: The name of the Maven global settings to use for
171 Maven configuration. (default: global-settings)
172 :mvn-version: Version of maven to use. (default: mvn35)
173 :stream: Keyword used to represent a release code-name.
174 Often the same as the branch. (default: master)
175 :submodule-recursive: Whether to checkout submodules recursively.
177 :gerrit_sonar_triggers: Override Gerrit Triggers.
178 :gerrit_trigger_file_paths: Override file paths which used to filter which
179 file modifications will trigger a build. Refer to JJB documentation for
181 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
187 Tox runner to verify a project. This job is pyenv aware so if the image
188 contains an installation of pyenv at /opt/pyenv it will pick it up and run
189 Python tests with the appropriate Python versions. This job will set the
190 following pyenv variables before running.
194 export PYENV_ROOT="/opt/pyenv"
195 export PATH="$PYENV_ROOT/bin:$PATH"
199 - {project-name}-tox-verify-{stream}
203 :Comment Trigger: recheck|reverify
205 :Required Parameters:
207 :build-node: The node to run build on.
208 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
211 :Optional Parameters:
213 :branch: The branch to build against. (default: master)
214 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
215 :build-timeout: Timeout in minutes before aborting build. (default: 10)
216 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
217 :python-version: Version of Python to configure as a base in virtualenv.
219 :stream: Keyword representing a release code-name.
220 Often the same as the branch. (default: master)
221 :submodule-recursive: Whether to checkout submodules recursively.
223 :tox-dir: Directory containing the project's tox.ini relative to
224 the workspace. Empty works if tox.ini is at project root.
226 :tox-envs: Tox environments to run. If blank run everything described
227 in tox.ini. (default: '')
228 :gerrit_trigger_file_paths: Override file paths which used to filter which
229 file modifications will trigger a build. Refer to JJB documentation for
231 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit