8 .. include:: ../job-groups.rst
10 Below is a list of Python job groups:
12 .. literalinclude:: ../../jjb/lf-python-job-groups.yaml
19 lf-infra-nexus-iq-python-cli
20 ----------------------------
22 Runs Nexus IQ command-line interface CLM scan on Python package requirements.
26 :nexus-iq-project-name: Project name in Nexus IQ to send results to.
27 :requirements-file: File name with output of pip freeze.
32 Installs Tox into a virtualenv.
36 :python-version: Version of Python to invoke the pip install of the tox-pyenv
37 package that creates a virtual environment, either "python2" or "python3".
42 Creates a Tox virtual environment and invokes tox.
46 :parallel: Boolean. If true use tox with the options "--parallel auto"
47 and "--parallel-live" to parallelize jobs in the envlist;
56 The Nexus IQ job invokes tox and the Nexus IQ scanner to analyze packages for
57 component lifecycle management (CLM). Runs tox to discover the required packages,
58 downloads the command-line interface (CLI) scanner, runs the scanner on the package
59 list, then uploads the results to a Nexus IQ server. The project's tox.ini file must
60 define a test environment that runs 'pip freeze' and captures the output; that
61 environment does not need to execute any tests. For example:
66 # use pip to report dependencies with versions
67 whitelist_externals = sh
68 commands = sh -c 'pip freeze > requirements.txt'
71 This job runs on the master branch because the basic Nexus IQ configuration
72 does not support multi-branch.
76 - {project-name}-tox-nexus-iq-clm
77 - gerrit-tox-nexus-iq-clm
78 - github-tox-nexus-iq-clm
80 :Comment Trigger: ``run-clm``
84 :build-node: The node to run the build on.
85 (Commonly in defaults.yaml)
86 :jenkins-ssh-credential: Credential to use for SSH.
87 (Commonly in defaults.yaml)
88 :project: The git repository name.
89 :project-name: Prefix used to name jobs.
93 :archive-artifacts: Pattern for files to archive to the logs server
94 (default: '\*\*/\*.log')
95 :branch: Git branch, should be master (default: master)
96 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
97 :build-timeout: Timeout in minutes before aborting build. (default: 15)
98 :cron: Cron schedule when to trigger the job. This parameter also
99 supports multiline input via the YAML pipe | character to allow
100 more than 1 cron timer. (default: @weekly)
101 :disable-job: Whether to disable the job (default: false)
102 :gerrit_nexusiq_triggers: Override Gerrit Triggers.
103 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
104 :github-url: URL for Github. (default: https://github.com)
105 :java-version: Version of Java to use for the scan. (default: openjdk8)
106 :nexus-iq-cli-version: Nexus IQ CLI package version to download and use.
107 (default is a string like 1.89.0-02, see file lf-python-jobs.yaml)
108 :nexus-iq-namespace: Insert a namespace to project AppID for projects that
109 share a Nexus IQ system to avoid project name collision. We recommend
110 inserting a trailing - dash if using this parameter.
111 For example 'odl-'. (default: '')
112 :pre-build-script: Shell script to run before tox. Useful for setting up
113 dependencies. (default: a string with a shell comment)
114 :python-version: Python version to invoke pip install of tox-pyenv
116 :requirements-file: Name of file with output of pip freeze.
117 (default: requirements.txt)
118 :submodule-recursive: Whether to checkout submodules recursively.
120 :submodule-timeout: Timeout (in minutes) for checkout operation.
122 :submodule-disable: Disable submodule checkout operation.
124 :tox-dir: Directory containing the project's tox.ini relative to
125 the workspace. The default uses tox.ini at the project root.
127 :tox-envs: Tox environment with the appropriate pip freeze invocation.
131 Python Sonar with Tox
132 ---------------------
134 Sonar scans for Python based repos. This job invokes tox to run tests
135 and gather coverage statistics from the test results, then invokes
136 Maven to publish the results to either a Sonar server or SonarCloud.
138 **Deprecated**, new projects should use Tox Sonarqube.
140 To get the Sonar coverage results, file tox.ini must exist and contain
141 coverage commands to run.
143 The coverage commands define the code that gets executed by the test
144 suites. Checking coverage does not guarantee that the tests execute
145 properly, but it identifies code that is not executed by any test.
147 This job reuses the Sonar builders used for Java/Maven projects which
148 run maven twice. The first invocation does nothing for Python
149 projects, so the job uses the goal ``validate`` by default. The second
150 invocation publishes results using the goal ``sonar:sonar`` by default.
158 coverage run --module pytest --junitxml xunit-results.xml
159 coverage xml --omit=".tox/py3/*","tests/*"
160 coverage report --omit=".tox/py3/*","tests/*"
162 For more details refer to coverage and sonar documentation:
164 https://coverage.readthedocs.io/
166 https://docs.sonarqube.org/display/PLUG/Python+Coverage+Results+Import
170 - {project-name}-tox-sonar
174 :Comment Trigger: **run-sonar** post a comment with the trigger to launch
175 this job manually. Do not include any other text or vote in the
178 :Required parameters:
180 :build-node: The node to run build on.
181 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
182 get configured in defaults.yaml)
183 :mvn-settings: The name of the settings file with credentials for the project.
185 .. comment Start ignoring WriteGoodLintBear
187 :Optional parameters:
189 :branch: Git branch, should be master (default: master)
190 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
191 :build-timeout: Timeout in minutes before aborting build. (default: 60)
192 :cron: Cron schedule when to trigger the job. This parameter also
193 supports multiline input via YAML pipe | character in cases where
194 one may want to provide more than 1 cron timer. (default: H 11 * * *
196 :disable-job: Whether to disable the job (default: false)
197 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
198 :github-url: URL for Github. (default: https://github.com)
199 :java-version: Version of Java to use for the build. (default: openjdk8)
200 :mvn-global-settings: The name of the Maven global settings to use
201 :mvn-goals: The Maven goal to run first. (default: validate)
202 :mvn-version: Version of maven to use. (default: mvn35)
203 :parallel: Boolean indicator for tox to run tests in parallel or series.
204 (default: false, in series)
205 If true use tox with the options "--parallel auto" and "--parallel-live"
206 to parallelize jobs in the envlist.
207 :pre-build-script: Shell script to execute before the Sonar builder.
208 For example, install prerequisites or move files to the repo root.
209 (default: a string with a shell comment)
210 :python-version: Python version to invoke pip install of tox-pyenv
212 :sonarcloud: Boolean indicator to use SonarCloud ``true|false``.
214 :sonarcloud-project-key: SonarCloud project key. (default: '')
215 :sonarcloud-project-organization: SonarCloud project organization.
217 :sonarcloud-api-token: SonarCloud API Token. (default: '')
218 :sonar-mvn-goal: The Maven goal to run the Sonar plugin. (default: sonar:sonar)
219 :stream: Keyword used to represent a release code-name.
220 Often the same as the branch. (default: master)
221 :submodule-recursive: Whether to checkout submodules recursively.
223 :submodule-timeout: Timeout (in minutes) for checkout operation.
225 :submodule-disable: Disable submodule checkout operation.
227 :tox-dir: Directory containing the project's tox.ini relative to
228 the workspace. The default uses tox.ini at the project root.
230 :tox-envs: Tox environments to run. If blank run everything described
231 in tox.ini. (default: '')
232 :gerrit_sonar_triggers: Override Gerrit Triggers.
233 :gerrit_trigger_file_paths: Override file paths used to filter which file
234 modifications trigger a build. Refer to JJB documentation for "file-path" details.
235 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
237 .. comment Stop ignoring
243 The SonarQube job invokes tox to run tests and generate code-coverage
244 statistics, then runs the SonarQube Scanner Jenkins plug-in to analyze
245 code, gather coverage data, and upload the results to a SonarQube server
246 such as SonarCloud.io. Optionally runs a shell script before tox.
248 Requires ``SonarQube Scanner for Jenkins``
250 This job runs on the master branch because the basic Sonar configuration
251 does not support multi-branch.
253 Plug-in configurations
254 Manage Jenkins --> Configure System --> SonarQube servers
255 - Name: Sonar (fixed)
256 - Server URL: https://sonar.project.org/ or https://sonarcloud.io
257 - Server authentication token: none for local, API token (saved as
258 a "secret text" credential) for Sonarcloud
260 Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner
261 - Name: SonarQube Scanner (fixed)
262 - Install automatically
263 - Select latest version
267 - {project-name}-tox-sonarqube
268 - gerrit-tox-sonarqube
269 - github-tox-sonarqube
271 :Comment Trigger: ``run-sonar``
273 :Required parameters:
275 :build-node: The node to run the build on.
276 (Commonly in defaults.yaml)
277 :jenkins-ssh-credential: Credential to use for SSH.
278 (Commonly in defaults.yaml)
279 :project: The git repository name.
280 :project-name: Prefix used to name jobs.
282 .. comment Start ignoring WriteGoodLintBear
284 :Optional Parameters:
286 :archive-artifacts: Pattern for files to archive to the logs server
287 (default: '\*\*/\*.log')
288 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
289 :build-timeout: Timeout in minutes before aborting build. (default: 15)
290 :cron: Cron schedule when to trigger the job. This parameter also
291 supports multiline input via YAML pipe | character in cases where
292 one may want to provide more than 1 cron timer. (default: @weekly)
293 :disable-job: Whether to disable the job (default: false)
294 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
295 :github-url: URL for Github. (default: https://github.com)
296 :parallel: Boolean indicator for tox to run tests in parallel or series.
297 (default: false, in series)
298 If true use tox with the options "--parallel auto" and "--parallel-live"
299 to parallelize jobs in the envlist.
300 :pre-build-script: Shell script to run before tox. Useful for setting up
301 dependencies. (default: a string with a shell comment)
302 :python-version: Python version to invoke pip install of tox-pyenv
304 :sonar-additional-args: Command line arguments. (default: '')
305 :sonar-java-opts: JVM options. For example, use option -Xmx
306 to increase the memory size limit. (default: '')
307 :sonar-project-file: The file name with Sonar configuration properties
308 (default: sonar-project.properties)
309 :sonar-properties: Sonar configuration properties. (default: '')
310 :sonar-task: Sonar task to run. (default: '')
311 :tox-dir: Directory containing the project's tox.ini relative to
312 the workspace. The default uses tox.ini at the project root.
314 :tox-envs: Tox environments to run. If blank run everything described
315 in tox.ini. (default: '')
317 .. comment Stop ignoring
319 .. note:: A job definition must provide one of the optional parameters
320 ``sonar-project-file`` and ``sonar-properties``; they cannot both be
321 empty. Set Sonar properties directly in the job definition by setting
322 the ``sonar-project-file`` property to ``""`` and adding all properties
323 under ``sonar-properties``.
325 :Required Sonar Properties:
327 - sonar.login: The API token for authentication at SonarCloud.
328 Commonly defined as key "sonarcloud_api_token" in defaults.yaml.
329 - sonar.organization: The umbrella project name; e.g., "opendaylight".
330 Commonly defined as key "sonarcloud_project_organization" in defaults.yaml.
331 - sonar.projectName: The git repository name without slashes; e.g., "infrautils".
332 - sonar.projectKey: The globally unique key for the report in SonarCloud. Most
333 teams use the catenation of sonar.organization, an underscore, and
334 sonar.projectName; e.g., "opendaylight_infrautils".
336 :Optional Sonar Properties:
338 - sonar.cfamily.gcov.reportsPath: directory with GCOV output files
339 - Documentation of SonarQube properties is here:
340 https://docs.sonarqube.org/latest/analysis/overview/
343 Example job definition
344 ^^^^^^^^^^^^^^^^^^^^^^
346 The following example defines a job for a basic Python project. This definition
347 uses configuration parameters in the umbrella project's defaults.yaml file.
352 name: my-package-sonar
354 project-name: my-package
355 sonar-project-file: ""
357 sonar.login={sonarcloud_api_token}
358 sonar.projectKey={sonarcloud_project_organization}_{project-name}
359 sonar.projectName={project-name}
360 sonar.organization={sonarcloud_project_organization}
361 sonar.sourceEncoding=UTF-8
362 sonar.sources=mypackage
363 sonar.exclusions=tests/*,setup.py
364 sonar.python.coverage.reportPaths=coverage.xml
366 - gerrit-tox-sonarqube
372 Tox runner to verify a project on creation of a patch set. This job
373 is pyenv aware so if the image contains an installation of pyenv at
374 /opt/pyenv it will pick it up and run Python tests with the
375 appropriate Python versions. This job will set the following pyenv
376 variables before running.
380 export PYENV_ROOT="/opt/pyenv"
381 export PATH="$PYENV_ROOT/bin:$PATH"
385 - {project-name}-tox-verify-{stream}
389 :Comment Trigger: **recheck|reverify** post a comment with one of the
390 triggers to launch this job manually. Do not include any other
391 text or vote in the same comment.
393 :Required Parameters:
395 :build-node: The node to run build on.
396 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
399 :Optional Parameters:
401 :branch: The branch to build against. (default: master)
402 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
403 :build-timeout: Timeout in minutes before aborting build. (default: 10)
404 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
405 :pre-build-script: Shell script to execute before the Tox builder.
406 For example, install prerequisites or move files to the repo root.
407 (default: a string with a shell comment)
408 :parallel: Boolean indicator for tox to run tests in parallel or series.
409 (default: false, in series)
410 If true use tox with the options "--parallel auto" and "--parallel-live"
411 to parallelize jobs in the envlist.
412 :python-version: Python version to invoke pip install of tox-pyenv
414 :stream: Keyword representing a release code-name.
415 Often the same as the branch. (default: master)
416 :submodule-recursive: Whether to checkout submodules recursively.
418 :submodule-timeout: Timeout (in minutes) for checkout operation.
420 :submodule-disable: Disable submodule checkout operation.
422 :tox-dir: Directory containing the project's tox.ini relative to
423 the workspace. The default uses tox.ini at the project root.
425 :tox-envs: Tox environments to run. If blank run everything described
426 in tox.ini. (default: '')
427 :gerrit_trigger_file_paths: Override file paths used to filter which file
428 modifications trigger a build. Refer to JJB documentation for "file-path" details.
429 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
435 Tox runner to verify a project after merge of a patch set. This job
436 is pyenv aware so if the image contains an installation of pyenv at
437 /opt/pyenv it will pick it up and run Python tests with the
438 appropriate Python versions. This job will set the following pyenv
439 variables before running.
443 export PYENV_ROOT="/opt/pyenv"
444 export PATH="$PYENV_ROOT/bin:$PATH"
448 - {project-name}-tox-merge-{stream}
452 :Comment Trigger: **remerge** post a comment with the trigger to launch
453 this job manually. Do not include any other text or vote in the
456 :Required Parameters:
458 :build-node: The node to run build on.
459 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
462 :Optional Parameters:
464 :branch: The branch to build against. (default: master)
465 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
466 :build-timeout: Timeout in minutes before aborting build. (default: 10)
467 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
468 :pre-build-script: Shell script to execute before the CLM builder.
469 For example, install prerequisites or move files to the repo root.
470 (default: a string with a shell comment)
471 :python-version: Python version to invoke pip install of tox-pyenv
473 :stream: Keyword representing a release code-name.
474 Often the same as the branch. (default: master)
475 :submodule-recursive: Whether to checkout submodules recursively.
477 :submodule-timeout: Timeout (in minutes) for checkout operation.
479 :submodule-disable: Disable submodule checkout operation.
481 :tox-dir: Directory containing the project's tox.ini relative to
482 the workspace. The default uses tox.ini at the project root.
484 :tox-envs: Tox environments to run. If blank run everything described
485 in tox.ini. (default: '')
486 :gerrit_trigger_file_paths: Override file paths used to filter which file
487 modifications trigger a build. Refer to JJB documentation for "file-path" details.
488 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
494 Creates and uploads package distribution files on merge of a patch set.
495 Runs tox, builds a source distribution and (optionally) a binary
496 distribution, and uploads the distribution(s) to a PyPI repository.
497 The project git repository must have a setup.py file
498 with configuration for packaging the component.
500 Projects can choose **either** this template to publish on merge,
501 **or** the Stage template to publish on command.
503 This job should use a staging repository like testpypi.python.org,
504 which sets up use of release jobs to promote the distributions later.
505 This job can also use a public release area like the global PyPI
506 repository if the release process is not needed. These PyPI
507 repositories allow upload of a package at a specific version once,
508 they do not allow overwrite of a package. This means that a merge job
509 will fail in the upload step if the package version already exists in
510 the target repository.
512 The tox runner is pyenv aware so if the image contains an installation
513 of pyenv at /opt/pyenv it will pick it up and run Python tests with
514 the appropriate Python versions. The tox runner sets the following
515 pyenv variables before running.
519 export PYENV_ROOT="/opt/pyenv"
520 export PATH="$PYENV_ROOT/bin:$PATH"
522 See the recommended directory layout documented in the PyPI Verify job.
524 Jobs using this PyPI template depend on a .pypirc configuration file
525 in the Jenkins builder home directory. An example appears next that uses
526 API tokens. Note that in the [pypi] entry the repository key-value pair
527 is optional, it defaults to pypi.org.
531 [distutils] # this tells distutils what package indexes you can push to
532 index-servers = pypi-test pypi
535 repository: https://test.pypi.org/legacy/
537 password: pypi-test-api-token-goes-here
541 password: pypi-api-token-goes-here
546 - {project-name}-pypi-merge-{stream}
550 :Comment Trigger: **remerge** post a comment with the trigger to launch
551 this job manually. Do not include any other text or vote in the
554 :Required Parameters:
556 :build-node: The node to run the build on.
557 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
559 :mvn-settings: The settings file with credentials for the project
560 :project: Git repository name
561 :project-name: Jenkins job name prefix
563 :Optional Parameters:
565 :branch: The branch to build against. (default: master)
566 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
567 :build-timeout: Timeout in minutes before aborting build. (default: 15)
568 :cron: Cron schedule when to trigger the job. Supports regular builds.
569 Not useful when publishing to pypi.org because that rejects a package
570 if the version exists. (default: empty)
571 :disable-job: Whether to disable the job (default: false)
572 :dist-binary: Whether to build a binary wheel distribution. (default: true)
573 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
574 :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
575 :mvn-params: Parameters to pass to the mvn CLI. (default: '')
576 :mvn-version: Version of maven to use. (default: mvn35)
577 :parallel: Boolean indicator for tox to run tests in parallel or series.
578 (default: false, in series)
579 If true use tox with the options "--parallel auto" and "--parallel-live"
580 to parallelize jobs in the envlist.
581 :pre-build-script: Shell script to execute before the tox builder. For
582 example, install system prerequisites. (default: a shell comment)
583 :pypi-repo: Key for the PyPI target repository in the .pypirc file,
584 ideally a server like test.pypi.org. (default: pypi-test)
585 :python-version: Python version to invoke pip install of tox-pyenv
587 :stream: Keyword representing a release code-name.
588 Often the same as the branch. (default: master)
589 :submodule-recursive: Whether to checkout submodules recursively.
591 :submodule-timeout: Timeout (in minutes) for checkout operation.
593 :submodule-disable: Disable submodule checkout operation.
595 :tox-dir: Directory containing the project's tox.ini relative to
596 the workspace. The default uses tox.ini at the project root.
598 :tox-envs: Tox environments to run. If blank run everything described
599 in tox.ini. (default: '')
600 :gerrit_trigger_file_paths: Override file paths used to filter which file
601 modifications trigger a build. Refer to JJB documentation for "file-path" details.
602 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
608 Creates and uploads package distribution files on receipt of a comment.
609 Runs tox, builds a source distribution and (optionally) a binary
610 distribution, and uploads the distribution(s) to a PyPI repository.
611 The project git repository must have a setup.py file with configuration
612 for packaging the component.
614 Projects can choose **either** this template to publish on command,
615 **or** the Merge template to publish on merge.
617 This job should use a staging repository like testpypi.python.org,
618 which sets up use of release jobs to promote the distributions later.
619 This job can also use a public release area like the global PyPI
620 repository if the release process is not needed. These PyPI
621 repositories allow upload of a package at a specific version once,
622 they do not allow overwrite of a package. This means that a job
623 will fail in the upload step if the package version already exists in
624 the target repository.
626 The tox runner is pyenv aware so if the image contains an installation
627 of pyenv at /opt/pyenv it will pick it up and run Python tests with
628 the appropriate Python versions. The tox runner sets the following
629 pyenv variables before running.
633 export PYENV_ROOT="/opt/pyenv"
634 export PATH="$PYENV_ROOT/bin:$PATH"
636 See the recommended directory layout documented in the PyPI Verify job.
638 Jobs using this PyPI template depend on a .pypirc configuration file
639 in the Jenkins builder home directory. An example appears next that uses
640 API tokens. Note that in the [pypi] entry the repository key-value pair
641 is optional, it defaults to pypi.org.
645 [distutils] # this tells distutils what package indexes you can push to
646 index-servers = pypi-test pypi
649 repository: https://test.pypi.org/legacy/
651 password: pypi-test-api-token-goes-here
655 password: pypi-api-token-goes-here
660 - {project-name}-pypi-stage-{stream}
664 :Comment Trigger: **stage-release** post a comment with the trigger to launch
665 this job manually. Do not include any other text or vote in the
668 :Required Parameters:
670 :build-node: The node to run the build on.
671 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
673 :mvn-settings: The settings file with credentials for the project
674 :project: Git repository name
675 :project-name: Jenkins job name prefix
677 :Optional Parameters:
679 :branch: The branch to build against. (default: master)
680 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
681 :build-timeout: Timeout in minutes before aborting build. (default: 15)
682 :cron: Cron schedule when to trigger the job. Supports regular builds.
683 Not useful when publishing to pypi.org because that rejects a package
684 if the version exists. (default: empty)
685 :disable-job: Whether to disable the job (default: false)
686 :dist-binary: Whether to build a binary wheel distribution. (default: true)
687 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
688 :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
689 :mvn-params: Parameters to pass to the mvn CLI. (default: '')
690 :mvn-version: Version of maven to use. (default: mvn35)
691 :parallel: Boolean indicator for tox to run tests in parallel or series.
692 (default: false, in series)
693 If true use tox with the options "--parallel auto" and "--parallel-live"
694 to parallelize jobs in the envlist.
695 :pre-build-script: Shell script to execute before the tox builder. For
696 example, install system prerequisites. (default: a shell comment)
697 :pypi-repo: Key for the PyPI target repository in the .pypirc file,
698 ideally a server like test.pypi.org. (default: pypi-test)
699 :python-version: Python version to invoke pip install of tox-pyenv
701 :stream: Keyword representing a release code-name.
702 Often the same as the branch. (default: master)
703 :submodule-recursive: Whether to checkout submodules recursively.
705 :submodule-timeout: Timeout (in minutes) for checkout operation.
707 :submodule-disable: Disable submodule checkout operation.
709 :tox-dir: Directory containing the project's tox.ini relative to
710 the workspace. The default uses tox.ini at the project root.
712 :tox-envs: Tox environments to run. If blank run everything described
713 in tox.ini. (default: '')
714 :gerrit_trigger_file_paths: Override file paths used to filter which file
715 modifications trigger a build. Refer to JJB documentation for "file-path" details.
716 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
721 Verifies a Python library project on creation of a patch set. Runs tox
722 then builds a source distribution and (optionally) a binary
723 distribution. The project repository must have a setup.py file with
724 configuration for packaging the component.
726 Installable package projects should use the directory layout shown
727 below. All Python files are in a repo subdirectory separate from
728 non-Python files like documentation. This layout allows highly
729 specific build-job triggers in Jenkins using the subdirectory
730 paths. For example, a PyPI publisher job should not run on a non-Python
731 file change such as documentation, because the job cannot upload the
734 To make the document files available for building a Python package
735 long description in setup.py, add a symbolic link "docs" in the
736 package subdirectory pointing to the top-level docs directory.
744 │ └── release-notes.rst
746 ├── helloworld-package/
750 │ │ ├── helloworld.py
754 │ │ ├── helloworld_tests.py
755 │ │ └── helloworld_mocks.py
757 │ ├── requirements.txt
762 │ └── pypi-helloworld.yaml
769 The tox runner is pyenv aware so if the image contains an installation
770 of pyenv at /opt/pyenv it will pick it up and run Python tests with
771 the appropriate Python versions. The tox runner sets the following
772 pyenv variables before running.
776 export PYENV_ROOT="/opt/pyenv"
777 export PATH="$PYENV_ROOT/bin:$PATH"
781 - {project-name}-pypi-verify-{stream}
785 :Comment Trigger: **recheck|reverify** post a comment with one of the
786 triggers to launch this job manually. Do not include any other
787 text or vote in the same comment.
789 :Required Parameters:
791 :build-node: The node to run the build on.
792 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
794 :mvn-settings: The settings file with credentials for the project
795 :project: Git repository name
796 :project-name: Jenkins job name prefix
798 :Optional Parameters:
800 :branch: The branch to build against. (default: master)
801 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
802 :build-timeout: Timeout in minutes before aborting build. (default: 15)
803 :disable-job: Whether to disable the job (default: false)
804 :dist-binary: Whether to build a binary wheel distribution. (default: true)
805 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
806 :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
807 :mvn-params: Parameters to pass to the mvn CLI. (default: '')
808 :mvn-version: Version of maven to use. (default: mvn35)
809 :parallel: Boolean indicator for tox to run tests in parallel or series.
810 (default: false, in series)
811 If true use tox with the options "--parallel auto" and "--parallel-live"
812 to parallelize jobs in the envlist.
813 :pre-build-script: Shell script to execute before the tox builder. For
814 example, install system prerequisites. (default: a shell comment)
815 :python-version: Python version to invoke pip install of tox-pyenv
817 :stream: Keyword representing a release code-name.
818 Often the same as the branch. (default: master)
819 :submodule-recursive: Whether to checkout submodules recursively.
821 :submodule-timeout: Timeout (in minutes) for checkout operation.
823 :submodule-disable: Disable submodule checkout operation.
825 :tox-dir: Directory containing the project's tox.ini relative to
826 the workspace. The default uses tox.ini at the project root.
828 :tox-envs: Tox environments to run. If blank run everything described
829 in tox.ini. (default: '')
830 :gerrit_trigger_file_paths: Override file paths used to filter which file
831 modifications trigger a build. Refer to JJB documentation for "file-path" details.
832 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit