8 .. include:: ../job-groups.rst
10 Below is a list of Maven job groups:
12 .. literalinclude:: ../../jjb/lf-python-job-groups.yaml
22 Run CLM scanning against a Python project.
26 :clm-project-name: Project name in Nexus IQ to send results to.
31 Install Tox into a virtualenv.
35 :python-version: Version of Python to install into the Tox virtualenv.
41 Runs Sonar scanning against a Python project.
45 :java-version: Version of Java to use to run Sonar.
46 :mvn-version: Version of Maven to use to run Sonar.
51 Runs a shell script that installs tox in a Python virtualenv.
55 :python-version: Base Python version to use in the virtualenv. For example
65 CLM scans for Python based repos. This job will call the Nexus IQ CLI
66 directly to run the scans.
68 A new credential named "nexus-iq-xc-clm" needs to exist in the Jenkins credentials.
69 The credential should contain the username and password to access Nexus
74 - {project-name}-python-clm-{stream}
75 - gerrit-python-xc-clm
76 - github-python-xc-clm
78 :Comment Trigger: run-clm
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)
88 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
89 :nexus-iq-cli-version: Nexus IQ CLI package version to download and use.
91 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
92 share a Nexus IQ system to avoid project name collision. We recommend
93 inserting a trailing - dash if using this parameter.
94 For example 'odl-'. (default: '')
95 :build-timeout: Timeout in minutes before aborting build. (default: 60)
96 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
97 :java-version: Version of Java to use for the build. (default: openjdk8)
98 :stream: Keyword used to represent a release code-name.
99 Often the same as the branch. (default: master)
100 :submodule-recursive: Whether to checkout submodules recursively.
102 :submodule-timeout: Timeout (in minutes) for checkout operation.
104 :gerrit_clm_triggers: Override Gerrit Triggers.
105 :gerrit_trigger_file_paths: Override file paths which used to filter which
106 file modifications will trigger a build. Refer to JJB documentation for
108 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
111 Python Sonar with Tox
112 ---------------------
114 Sonar scans for Python based repos. This job will perform a tox call which
115 runs the coverage command to gather tests results. These test results get
116 published back into Sonar after running the Sonar goals.
118 To get the Sonar coverage results, tox.ini needs to exist and configured
119 with coverage commands to run.
121 The coverage commands define the code that gets executed by the test suites.
122 It does not guarantee that the code tests executed properly, but it will help
123 pointing out the code that is not tested at all.
131 coverage run --module pytest --junitxml xunit-results.xml
132 coverage xml --omit=".tox/py27/*","tests/*"
133 coverage report --omit=".tox/py27/*","tests/*"
135 For more details refer to coverage and sonar documentation:
137 https://coverage.readthedocs.io/
139 https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import
143 - {project-name}-tox-sonar
147 :Comment Trigger: run-sonar
149 :Required parameters:
151 :build-node: The node to run build on.
152 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
153 get configured in defaults.yaml)
154 :mvn-settings: The name of settings file containing credentials for the project.
156 :Optional parameters:
158 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
159 :build-timeout: Timeout in minutes before aborting build. (default: 60)
160 :cron: Cron schedule when to trigger the job. This parameter also
161 supports multiline input via YAML pipe | character in cases where
162 one may want to provide more than 1 cron timer. (default: H 11 * * *
164 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
165 :java-version: Version of Java to use for the build. (default: openjdk8)
166 :mvn-global-settings: The name of the Maven global settings to use for
167 Maven configuration. (default: global-settings)
168 :mvn-version: Version of maven to use. (default: mvn35)
169 :stream: Keyword used to represent a release code-name.
170 Often the same as the branch. (default: master)
171 :submodule-recursive: Whether to checkout submodules recursively.
173 :submodule-timeout: Timeout (in minutes) for checkout operation.
175 :gerrit_sonar_triggers: Override Gerrit Triggers.
176 :gerrit_trigger_file_paths: Override file paths which used to filter which
177 file modifications will trigger a build. Refer to JJB documentation for
179 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
185 Tox runner to verify a project. This job is pyenv aware so if the image
186 contains an installation of pyenv at /opt/pyenv it will pick it up and run
187 Python tests with the appropriate Python versions. This job will set the
188 following pyenv variables before running.
192 export PYENV_ROOT="/opt/pyenv"
193 export PATH="$PYENV_ROOT/bin:$PATH"
197 - {project-name}-tox-verify-{stream}
201 :Comment Trigger: recheck|reverify
203 :Required Parameters:
205 :build-node: The node to run build on.
206 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
209 :Optional Parameters:
211 :branch: The branch to build against. (default: master)
212 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
213 :build-timeout: Timeout in minutes before aborting build. (default: 10)
214 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
215 :python-version: Version of Python to configure as a base in virtualenv.
217 :stream: Keyword representing a release code-name.
218 Often the same as the branch. (default: master)
219 :submodule-recursive: Whether to checkout submodules recursively.
221 :submodule-timeout: Timeout (in minutes) for checkout operation.
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