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 CLM scans for Python based repos. This job will call the Nexus IQ CLI
48 directly to run the scans.
50 A new credential named "nexus-iq-xc-clm" needs to exist in the Jenkins credentials.
51 The credential should contain the username and password to access Nexus
56 - {project-name}-python-clm-{stream}
57 - gerrit-python-xc-clm
58 - github-python-xc-clm
62 :build-node: The node to run build on.
63 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
64 get configured in defaults.yaml)
68 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
69 :nexus-iq-cli-version: Nexus IQ CLI package version to download and use. (default: 1.44.0-01)
70 :build-timeout: Timeout in seconds before aborting build. (default: 60)
71 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
72 :java-version: Version of Java to use for the build. (default: openjdk8)
73 :stream: Keyword used to represent a release code-name.
74 Often the same as the branch. (default: master)
75 :submodule-recursive: Whether to checkout submodules recursively.
77 :gerrit_clm_triggers: Override Gerrit Triggers.
82 Sonar scans for Python based repos. This job will perform a tox call which
83 runs the coverage command to gather tests results. These test results get
84 published back into Sonar after running the Sonar goals.
86 To get the Sonar coverage results, tox.ini needs to exist and configured
87 with coverage commands to run.
89 The coverage commands define the code that gets executed by the test suites.
90 It does not guarantee that the code tests executed properly, but it will help
91 pointing out the code that is not tested at all.
99 coverage run --module pytest --junitxml xunit-results.xml
100 coverage xml --omit=".tox/py27/*","tests/*"
101 coverage report --omit=".tox/py27/*","tests/*"
103 For more details refer to coverage and sonar documentation:
105 https://coverage.readthedocs.io/
107 https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import
111 - {project-name}-tox-sonar
115 :Required parameters:
117 :build-node: The node to run build on.
118 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
119 get configured in defaults.yaml)
120 :mvn-settings: The name of settings file containing credentials for the project.
122 :Optional parameters:
124 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
125 :build-timeout: Timeout in seconds before aborting build. (default: 60)
126 :cron: Cron schedule when to trigger the job. This parameter also
127 supports multiline input via YAML pipe | character in cases where
128 one may want to provide more than 1 cron timer. (default: H 11 * * *
130 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
131 :java-version: Version of Java to use for the build. (default: openjdk8)
132 :mvn-global-settings: The name of the Maven global settings to use for
133 Maven configuration. (default: global-settings)
134 :mvn-version: Version of maven to use. (default: mvn33)
135 :stream: Keyword used to represent a release code-name.
136 Often the same as the branch. (default: master)
137 :submodule-recursive: Whether to checkout submodules recursively.
139 :gerrit_sonar_triggers: Override Gerrit Triggers.
144 Tox runner to verify a project. This job is pyenv aware so if the image
145 contains an installation of pyenv at /opt/pyenv it will pick it up and run
146 Python tests with the appropriate Python versions. This job will set the
147 following pyenv variables before running.
151 export PYENV_ROOT="/opt/pyenv"
152 export PATH="$PYENV_ROOT/bin:$PATH"
156 - {project-name}-tox-verify-{stream}
160 :Required Parameters:
162 :build-node: The node to run build on.
163 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
166 :Optional Parameters:
168 :branch: The branch to build against. (default: master)
169 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
170 :build-timeout: Timeout in seconds before aborting build. (default: 10)
171 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
172 :python-version: Version of Python to configure as a base in virtualenv.
174 :stream: Keyword representing a release code-name.
175 Often the same as the branch. (default: master)
176 :submodule-recursive: Whether to checkout submodules recursively.
178 :tox-dir: Directory containing the project's tox.ini relative to
179 the workspace. Empty works if tox.ini is at project root.
181 :tox-envs: Tox environments to run. If blank run everything described
182 in tox.ini. (default: '')