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 detox (distributed tox);
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/py27/*","tests/*"
160 coverage report --omit=".tox/py27/*","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 :pre-build-script: Shell script to execute before the Sonar builder.
206 For example, install prerequisites or move files to the repo root.
207 (default: a string with a shell comment)
208 :python-version: Python version to invoke pip install of tox-pyenv
210 :sonarcloud: Boolean indicator to use SonarCloud ``true|false``.
212 :sonarcloud-project-key: SonarCloud project key. (default: '')
213 :sonarcloud-project-organization: SonarCloud project organization.
215 :sonarcloud-api-token: SonarCloud API Token. (default: '')
216 :sonar-mvn-goal: The Maven goal to run the Sonar plugin. (default: sonar:sonar)
217 :stream: Keyword used to represent 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 :submodule-disable: Disable submodule checkout operation.
225 :tox-dir: Directory containing the project's tox.ini relative to
226 the workspace. The default uses tox.ini at the project root.
228 :tox-envs: Tox environments to run. If blank run everything described
229 in tox.ini. (default: '')
230 :gerrit_sonar_triggers: Override Gerrit Triggers.
231 :gerrit_trigger_file_paths: Override file paths used to filter which file
232 modifications trigger a build. Refer to JJB documentation for "file-path" details.
233 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
235 .. comment Stop ignoring
241 The SonarQube job invokes tox to run tests and generate code-coverage
242 statistics, then runs the SonarQube Scanner Jenkins plug-in to analyze
243 code, gather coverage data, and upload the results to a SonarQube server
244 such as SonarCloud.io. Optionally runs a shell script before tox.
246 Requires ``SonarQube Scanner for Jenkins``
248 This job runs on the master branch because the basic Sonar configuration
249 does not support multi-branch.
251 Plug-in configurations
252 Manage Jenkins --> Configure System --> SonarQube servers
253 - Name: Sonar (fixed)
254 - Server URL: https://sonar.project.org/ or https://sonarcloud.io
255 - Server authentication token: none for local, API token (saved as
256 a "secret text" credential) for Sonarcloud
258 Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner
259 - Name: SonarQube Scanner (fixed)
260 - Install automatically
261 - Select latest version
265 - {project-name}-tox-sonarqube
266 - gerrit-tox-sonarqube
267 - github-tox-sonarqube
269 :Comment Trigger: ``run-sonar``
271 :Required parameters:
273 :build-node: The node to run the build on.
274 (Commonly in defaults.yaml)
275 :jenkins-ssh-credential: Credential to use for SSH.
276 (Commonly in defaults.yaml)
277 :project: The git repository name.
278 :project-name: Prefix used to name jobs.
280 .. comment Start ignoring WriteGoodLintBear
282 :Optional Parameters:
284 :archive-artifacts: Pattern for files to archive to the logs server
285 (default: '\*\*/\*.log')
286 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
287 :build-timeout: Timeout in minutes before aborting build. (default: 15)
288 :cron: Cron schedule when to trigger the job. This parameter also
289 supports multiline input via YAML pipe | character in cases where
290 one may want to provide more than 1 cron timer. (default: @weekly)
291 :disable-job: Whether to disable the job (default: false)
292 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
293 :github-url: URL for Github. (default: https://github.com)
294 :parallel: Boolean indicator for tox to run tests in parallel or series.
295 (default: false, in series)
296 :pre-build-script: Shell script to run before tox. Useful for setting up
297 dependencies. (default: a string with a shell comment)
298 :python-version: Python version to invoke pip install of tox-pyenv
300 :sonar-additional-args: Command line arguments. (default: '')
301 :sonar-java-opts: JVM options. For example, use option -Xmx
302 to increase the memory size limit. (default: '')
303 :sonar-project-file: The file name with Sonar configuration properties
304 (default: sonar-project.properties)
305 :sonar-properties: Sonar configuration properties. (default: '')
306 :sonar-task: Sonar task to run. (default: '')
307 :tox-dir: Directory containing the project's tox.ini relative to
308 the workspace. The default uses tox.ini at the project root.
310 :tox-envs: Tox environments to run. If blank run everything described
311 in tox.ini. (default: '')
313 .. comment Stop ignoring
315 .. note:: A job definition must provide one of the optional parameters
316 ``sonar-project-file`` and ``sonar-properties``; they cannot both be
317 empty. Set Sonar properties directly in the job definition by setting
318 the ``sonar-project-file`` property to ``""`` and adding all properties
319 under ``sonar-properties``.
321 :Required Sonar Properties:
323 - sonar.login: The API token for authentication at SonarCloud.
324 Commonly defined as key "sonarcloud_api_token" in defaults.yaml.
325 - sonar.organization: The umbrella project name; e.g., "opendaylight".
326 Commonly defined as key "sonarcloud_project_organization" in defaults.yaml.
327 - sonar.projectName: The git repository name without slashes; e.g., "infrautils".
328 - sonar.projectKey: The globally unique key for the report in SonarCloud. Most
329 teams use the catenation of sonar.organization, an underscore, and
330 sonar.projectName; e.g., "opendaylight_infrautils".
332 :Optional Sonar Properties:
334 - sonar.cfamily.gcov.reportsPath: directory with GCOV output files
335 - Documentation of SonarQube properties is here:
336 https://docs.sonarqube.org/latest/analysis/overview/
339 Example job definition
340 ^^^^^^^^^^^^^^^^^^^^^^
342 The following example defines a job for a basic Python project. This definition
343 uses configuration parameters in the umbrella project's defaults.yaml file.
348 name: my-package-sonar
350 project-name: my-package
351 sonar-project-file: ""
353 sonar.login={sonarcloud_api_token}
354 sonar.projectKey={sonarcloud_project_organization}_{project-name}
355 sonar.projectName={project-name}
356 sonar.organization={sonarcloud_project_organization}
357 sonar.sourceEncoding=UTF-8
358 sonar.sources=mypackage
359 sonar.exclusions=tests/*,setup.py
360 sonar.python.coverage.reportPaths=coverage.xml
362 - gerrit-tox-sonarqube
368 Tox runner to verify a project on creation of a patch set. This job
369 is pyenv aware so if the image contains an installation of pyenv at
370 /opt/pyenv it will pick it up and run Python tests with the
371 appropriate Python versions. This job will set the following pyenv
372 variables before running.
376 export PYENV_ROOT="/opt/pyenv"
377 export PATH="$PYENV_ROOT/bin:$PATH"
381 - {project-name}-tox-verify-{stream}
385 :Comment Trigger: **recheck|reverify** post a comment with one of the
386 triggers to launch this job manually. Do not include any other
387 text or vote in the same comment.
389 :Required Parameters:
391 :build-node: The node to run build on.
392 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
395 :Optional Parameters:
397 :branch: The branch to build against. (default: master)
398 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
399 :build-timeout: Timeout in minutes before aborting build. (default: 10)
400 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
401 :pre-build-script: Shell script to execute before the Tox builder.
402 For example, install prerequisites or move files to the repo root.
403 (default: a string with a shell comment)
404 :parallel: Boolean indicator for tox to run tests in parallel or series.
405 (default: false, in series)
406 :python-version: Python version to invoke pip install of tox-pyenv
408 :stream: Keyword representing a release code-name.
409 Often the same as the branch. (default: master)
410 :submodule-recursive: Whether to checkout submodules recursively.
412 :submodule-timeout: Timeout (in minutes) for checkout operation.
414 :submodule-disable: Disable submodule checkout operation.
416 :tox-dir: Directory containing the project's tox.ini relative to
417 the workspace. The default uses tox.ini at the project root.
419 :tox-envs: Tox environments to run. If blank run everything described
420 in tox.ini. (default: '')
421 :gerrit_trigger_file_paths: Override file paths used to filter which file
422 modifications trigger a build. Refer to JJB documentation for "file-path" details.
423 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
429 Tox runner to verify a project after merge of a patch set. This job
430 is pyenv aware so if the image contains an installation of pyenv at
431 /opt/pyenv it will pick it up and run Python tests with the
432 appropriate Python versions. This job will set the following pyenv
433 variables before running.
437 export PYENV_ROOT="/opt/pyenv"
438 export PATH="$PYENV_ROOT/bin:$PATH"
442 - {project-name}-tox-merge-{stream}
446 :Comment Trigger: **remerge** post a comment with the trigger to launch
447 this job manually. Do not include any other text or vote in the
450 :Required Parameters:
452 :build-node: The node to run build on.
453 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
456 :Optional Parameters:
458 :branch: The branch to build against. (default: master)
459 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
460 :build-timeout: Timeout in minutes before aborting build. (default: 10)
461 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
462 :pre-build-script: Shell script to execute before the CLM builder.
463 For example, install prerequisites or move files to the repo root.
464 (default: a string with a shell comment)
465 :python-version: Python version to invoke pip install of tox-pyenv
467 :stream: Keyword representing a release code-name.
468 Often the same as the branch. (default: master)
469 :submodule-recursive: Whether to checkout submodules recursively.
471 :submodule-timeout: Timeout (in minutes) for checkout operation.
473 :submodule-disable: Disable submodule checkout operation.
475 :tox-dir: Directory containing the project's tox.ini relative to
476 the workspace. The default uses tox.ini at the project root.
478 :tox-envs: Tox environments to run. If blank run everything described
479 in tox.ini. (default: '')
480 :gerrit_trigger_file_paths: Override file paths used to filter which file
481 modifications trigger a build. Refer to JJB documentation for "file-path" details.
482 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
488 Creates and uploads package distribution files on merge of a patch set.
489 Runs tox, builds a source distribution and (optionally) a binary
490 distribution, and uploads the distribution(s) to a PyPI repository.
491 The project git repository must have a setup.py file
492 with configuration for packaging the component.
494 Projects can choose **either** this template to publish on merge,
495 **or** the Stage template to publish on command.
497 This job should use a staging repository like testpypi.python.org,
498 which sets up use of release jobs to promote the distributions later.
499 This job can also use a public release area like the global PyPI
500 repository if the release process is not needed. These PyPI
501 repositories allow upload of a package at a specific version once,
502 they do not allow overwrite of a package. This means that a merge job
503 will fail in the upload step if the package version already exists in
504 the target repository.
506 The tox runner is pyenv aware so if the image contains an installation
507 of pyenv at /opt/pyenv it will pick it up and run Python tests with
508 the appropriate Python versions. The tox runner sets the following
509 pyenv variables before running.
513 export PYENV_ROOT="/opt/pyenv"
514 export PATH="$PYENV_ROOT/bin:$PATH"
516 See the recommended directory layout documented in the PyPI Verify job.
518 Jobs using this PyPI template depend on a .pypirc configuration file
519 in the Jenkins builder home directory. An example appears next that uses
520 API tokens. Note that in the [pypi] entry the repository key-value pair
521 is optional, it defaults to pypi.org.
525 [distutils] # this tells distutils what package indexes you can push to
526 index-servers = pypi-test pypi
529 repository: https://test.pypi.org/legacy/
531 password: pypi-test-api-token-goes-here
535 password: pypi-api-token-goes-here
540 - {project-name}-pypi-merge-{stream}
544 :Comment Trigger: **remerge** post a comment with the trigger to launch
545 this job manually. Do not include any other text or vote in the
548 :Required Parameters:
550 :build-node: The node to run the build on.
551 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
553 :mvn-settings: The settings file with credentials for the project
554 :project: Git repository name
555 :project-name: Jenkins job name prefix
557 :Optional Parameters:
559 :branch: The branch to build against. (default: master)
560 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
561 :build-timeout: Timeout in minutes before aborting build. (default: 15)
562 :cron: Cron schedule when to trigger the job. Supports regular builds.
563 Not useful when publishing to pypi.org because that rejects a package
564 if the version exists. (default: empty)
565 :disable-job: Whether to disable the job (default: false)
566 :dist-binary: Whether to build a binary wheel distribution. (default: true)
567 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
568 :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
569 :mvn-params: Parameters to pass to the mvn CLI. (default: '')
570 :mvn-version: Version of maven to use. (default: mvn35)
571 :parallel: Boolean indicator for tox to run tests in parallel or series.
572 (default: false, in series)
573 :pre-build-script: Shell script to execute before the tox builder. For
574 example, install system prerequisites. (default: a shell comment)
575 :pypi-repo: Key for the PyPI target repository in the .pypirc file,
576 ideally a server like test.pypi.org. (default: pypi-test)
577 :python-version: Python version to invoke pip install of tox-pyenv
579 :stream: Keyword representing a release code-name.
580 Often the same as the branch. (default: master)
581 :submodule-recursive: Whether to checkout submodules recursively.
583 :submodule-timeout: Timeout (in minutes) for checkout operation.
585 :submodule-disable: Disable submodule checkout operation.
587 :tox-dir: Directory containing the project's tox.ini relative to
588 the workspace. The default uses tox.ini at the project root.
590 :tox-envs: Tox environments to run. If blank run everything described
591 in tox.ini. (default: '')
592 :gerrit_trigger_file_paths: Override file paths used to filter which file
593 modifications trigger a build. Refer to JJB documentation for "file-path" details.
594 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
600 Creates and uploads package distribution files on receipt of a comment.
601 Runs tox, builds a source distribution and (optionally) a binary
602 distribution, and uploads the distribution(s) to a PyPI repository.
603 The project git repository must have a setup.py file with configuration
604 for packaging the component.
606 Projects can choose **either** this template to publish on command,
607 **or** the Merge template to publish on merge.
609 This job should use a staging repository like testpypi.python.org,
610 which sets up use of release jobs to promote the distributions later.
611 This job can also use a public release area like the global PyPI
612 repository if the release process is not needed. These PyPI
613 repositories allow upload of a package at a specific version once,
614 they do not allow overwrite of a package. This means that a job
615 will fail in the upload step if the package version already exists in
616 the target repository.
618 The tox runner is pyenv aware so if the image contains an installation
619 of pyenv at /opt/pyenv it will pick it up and run Python tests with
620 the appropriate Python versions. The tox runner sets the following
621 pyenv variables before running.
625 export PYENV_ROOT="/opt/pyenv"
626 export PATH="$PYENV_ROOT/bin:$PATH"
628 See the recommended directory layout documented in the PyPI Verify job.
630 Jobs using this PyPI template depend on a .pypirc configuration file
631 in the Jenkins builder home directory. An example appears next that uses
632 API tokens. Note that in the [pypi] entry the repository key-value pair
633 is optional, it defaults to pypi.org.
637 [distutils] # this tells distutils what package indexes you can push to
638 index-servers = pypi-test pypi
641 repository: https://test.pypi.org/legacy/
643 password: pypi-test-api-token-goes-here
647 password: pypi-api-token-goes-here
652 - {project-name}-pypi-stage-{stream}
656 :Comment Trigger: **stage-release** post a comment with the trigger to launch
657 this job manually. Do not include any other text or vote in the
660 :Required Parameters:
662 :build-node: The node to run the build on.
663 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
665 :mvn-settings: The settings file with credentials for the project
666 :project: Git repository name
667 :project-name: Jenkins job name prefix
669 :Optional Parameters:
671 :branch: The branch to build against. (default: master)
672 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
673 :build-timeout: Timeout in minutes before aborting build. (default: 15)
674 :cron: Cron schedule when to trigger the job. Supports regular builds.
675 Not useful when publishing to pypi.org because that rejects a package
676 if the version exists. (default: empty)
677 :disable-job: Whether to disable the job (default: false)
678 :dist-binary: Whether to build a binary wheel distribution. (default: true)
679 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
680 :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
681 :mvn-params: Parameters to pass to the mvn CLI. (default: '')
682 :mvn-version: Version of maven to use. (default: mvn35)
683 :parallel: Boolean indicator for tox to run tests in parallel or series.
684 (default: false, in series)
685 :pre-build-script: Shell script to execute before the tox builder. For
686 example, install system prerequisites. (default: a shell comment)
687 :pypi-repo: Key for the PyPI target repository in the .pypirc file,
688 ideally a server like test.pypi.org. (default: pypi-test)
689 :python-version: Python version to invoke pip install of tox-pyenv
691 :stream: Keyword representing a release code-name.
692 Often the same as the branch. (default: master)
693 :submodule-recursive: Whether to checkout submodules recursively.
695 :submodule-timeout: Timeout (in minutes) for checkout operation.
697 :submodule-disable: Disable submodule checkout operation.
699 :tox-dir: Directory containing the project's tox.ini relative to
700 the workspace. The default uses tox.ini at the project root.
702 :tox-envs: Tox environments to run. If blank run everything described
703 in tox.ini. (default: '')
704 :gerrit_trigger_file_paths: Override file paths used to filter which file
705 modifications trigger a build. Refer to JJB documentation for "file-path" details.
706 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
711 Verifies a Python library project on creation of a patch set. Runs tox
712 then builds a source distribution and (optionally) a binary
713 distribution. The project repository must have a setup.py file with
714 configuration for packaging the component.
716 Installable package projects should use the directory layout shown
717 below. All Python files are in a repo subdirectory separate from
718 non-Python files like documentation. This layout allows highly
719 specific build-job triggers in Jenkins using the subdirectory
720 paths. For example, a PyPI publisher job should not run on a non-Python
721 file change such as documentation, because the job cannot upload the
724 To make the document files available for building a Python package
725 long description in setup.py, add a symbolic link "docs" in the
726 package subdirectory pointing to the top-level docs directory.
734 │ └── release-notes.rst
736 ├── helloworld-package/
740 │ │ ├── helloworld.py
744 │ │ ├── helloworld_tests.py
745 │ │ └── helloworld_mocks.py
747 │ ├── requirements.txt
752 │ └── pypi-helloworld.yaml
759 The tox runner is pyenv aware so if the image contains an installation
760 of pyenv at /opt/pyenv it will pick it up and run Python tests with
761 the appropriate Python versions. The tox runner sets the following
762 pyenv variables before running.
766 export PYENV_ROOT="/opt/pyenv"
767 export PATH="$PYENV_ROOT/bin:$PATH"
771 - {project-name}-pypi-verify-{stream}
775 :Comment Trigger: **recheck|reverify** post a comment with one of the
776 triggers to launch this job manually. Do not include any other
777 text or vote in the same comment.
779 :Required Parameters:
781 :build-node: The node to run the build on.
782 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
784 :mvn-settings: The settings file with credentials for the project
785 :project: Git repository name
786 :project-name: Jenkins job name prefix
788 :Optional Parameters:
790 :branch: The branch to build against. (default: master)
791 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
792 :build-timeout: Timeout in minutes before aborting build. (default: 15)
793 :disable-job: Whether to disable the job (default: false)
794 :dist-binary: Whether to build a binary wheel distribution. (default: true)
795 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
796 :mvn-opts: Sets MAVEN_OPTS to start up the JVM running Maven. (default: '')
797 :mvn-params: Parameters to pass to the mvn CLI. (default: '')
798 :mvn-version: Version of maven to use. (default: mvn35)
799 :parallel: Boolean indicator for tox to run tests in parallel or series.
800 (default: false, in series)
801 :pre-build-script: Shell script to execute before the tox builder. For
802 example, install system prerequisites. (default: a shell comment)
803 :python-version: Python version to invoke pip install of tox-pyenv
805 :stream: Keyword representing a release code-name.
806 Often the same as the branch. (default: master)
807 :submodule-recursive: Whether to checkout submodules recursively.
809 :submodule-timeout: Timeout (in minutes) for checkout operation.
811 :submodule-disable: Disable submodule checkout operation.
813 :tox-dir: Directory containing the project's tox.ini relative to
814 the workspace. The default uses tox.ini at the project root.
816 :tox-envs: Tox environments to run. If blank run everything described
817 in tox.ini. (default: '')
818 :gerrit_trigger_file_paths: Override file paths used to filter which file
819 modifications trigger a build. Refer to JJB documentation for "file-path" details.
820 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit