8 .. include:: ../job-groups.rst
10 Below is a list of CI job groups:
12 .. literalinclude:: ../../jjb/lf-ci-job-groups.yaml
19 lf-infra-jjb-parameters
20 -----------------------
24 :jjb-cache: Location of Jenkins Job Builder (JJB) cache used for jjb
26 :jjb-version: Version of Jenkins Job Builder (JJB) to install and use in
32 Deploys Jenkins Cloud configuration read from the ``jenkins-clouds`` directory
33 in ci-management repositories.
37 Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
38 config definitions for "production" and "sandbox" systems.
42 :jenkins-silos: Space-separated list of Jenkins silos to update
43 configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
45 lf-jenkins-cfg-global-vars
46 --------------------------
48 Manages the Global Jenkins variables. This macro will clear all exist macros
49 in Jenkins and replaces them with the ones defined by the
50 ci-management/jenkins-config/global-vars-SILO.sh script.
54 Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
55 config definitions for "production" and "sandbox" systems.
59 :jenkins-silos: Space-separated list of Jenkins silos to update
60 configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
65 Provides jenkins_jobs.ini configuration for Jenkins.
70 Common packer configuration.
75 Gerrit file-paths for packer jobs.
80 Parameters useful for packer related tasks.
84 :packer-version: Version of packer to install / use.
85 (shell: PACKER_VERSION)
87 lf-packer-verify-file-paths
88 ---------------------------
90 Gerrit file-paths for packer verify jobs.
95 Parameters useful for Puppet related tasks.
99 :puppet-lint-version: Version of puppet-lint to install / use.
100 (shell: PUPPET_LINT_VERSION)
105 .. _gerrit-branch-lock:
110 Job submits a patch to lock or unlock a project's branch.
112 This job will process lock/unlock requests for all projects and all branches
113 and does not need to have per-project configuration.
116 - {project-name}-gerrit-branch-lock
124 :Required parameters:
126 :build-node: The node to run build on.
127 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
130 :Optional parameters:
132 :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
133 :submodule-timeout: Timeout (in minutes) for checkout operation.
135 :gerrit_merge_triggers: Override Gerrit Triggers.
137 .. _lf-global-jjb-jenkins-cfg-merge:
139 Jenkins Configuration Merge
140 ---------------------------
142 Jenkins job to manage Global Jenkins configuration.
146 Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
147 config definitions for "production" and "sandbox" systems.
151 - {project-name}-jenkins-cfg-merge
152 - gerrit-jenkins-cfg-merge
153 - github-jenkins-cfg-merge
155 :Optional parameters:
157 :branch: Git branch to build against. (default: master)
158 :cron: How often to run the job on a cron schedule. (default: @daily)
159 :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
160 :jenkins-silos: Space separated list of Jenkins silos to update
161 configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
162 (default: production sandbox)
164 Typically this template is automatically pulled in by the
165 "{project-name}-ci-jobs" job-group and does not need to be explicitly called if
166 you are already using the job group.
170 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml
175 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-merge-full.yaml
178 .. _jenkins-cfg-envvar:
180 Global Environment Variables
181 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
183 Manage Global Environment Variables via the
184 ``jenkins-config/global-vars-SILO.sh`` file in ci-management. Replace SILO with
185 the name of the Jenkins silo the variable configuration is for.
187 The format for this file is ``KEY=value`` for example::
189 GERRIT_URL=https://git.opendaylight.org/gerrit
190 GIT_BASE=git://devvexx.opendaylight.org/mirror/$PROJECT
191 GIT_URL=git://devvexx.opendaylight.org/mirror
192 JENKINS_HOSTNAME=vex-yul-odl-jenkins-2
193 LOGS_SERVER=https://logs.opendaylight.org
194 NEXUS_URL=https://nexus.opendaylight.org
195 ODLNEXUSPROXY=https://nexus.opendaylight.org
197 SONAR_URL=https://sonar.opendaylight.org
202 This configuration requires the **OpenStack Cloud plugin** in Jenkins.
204 OpenStack Cloud plugin version supported:
209 Cloud configuration follows a directory structure in ci-management like this:
211 - jenkins-config/clouds/openstack/
212 - jenkins-config/clouds/openstack/**cattle**/cloud.cfg
213 - jenkins-config/clouds/openstack/**cattle**/centos7-builder-2c-2g.cfg
214 - jenkins-config/clouds/openstack/**cattle**/centos7-builder-4c-4g.cfg
215 - jenkins-config/clouds/openstack/**cattle**/centos7-docker-4c-4g.cfg
217 This job uses the directory name of the directory inside of the "openstack"
218 directory as the name of the cloud configuration in Jenkins. This is to support
219 systems that want to use more than one cloud provider. In this example "cattle"
222 The ``cloud.cfg`` file is a special file used to configure the main cloud
223 configuration in the format ``KEY=value``.
227 :CLOUD_URL: API endpoint URL for Keystone.
229 :CLOUD_IGNORE_SSL: Ignore unverified SSL certificates. (default: false)
230 :CLOUD_ZONE: OpenStack region to use. (default: "")
231 :CLOUD_CREDENTIAL_ID: Credential to use for authentication to OpenStack.
232 (default: "os-cloud")
233 :INSTANCE_CAP: Total number of instances the cloud will allow spin up.
235 :SANDBOX_CAP: Total number of instances the cloud will allow to
236 spin up. This applies to "sandbox" systems and overrides the
237 INSTANCE_CAP setting. (default: null)
239 :Template Parameters:
243 Parameters below that are not defined will inherit the ones defined in
244 the default clouds configuration.
246 :IMAGE_NAME: The image name to use for this template. (required)
247 :HARDWARE_ID: OpenStack flavor to use. (required)
249 :LABELS: Labels to assign to the vm. (default: FILE_NAME)
250 :VOLUME_SIZE: Volume size to assign to vm. (default: "")
251 :HARDWARE_ID: Hardware Id to assign to vm. (default: "")
252 :NETWORK_ID: OpenStack network to use. (default: "")
253 :USER_DATA_ID: User Data to pass into the instance.
254 (default: jenkins-init-script)
255 :INSTANCE_CAP: Total number of instances of this type that is available for
256 use at one time. When defined in clouds.cfg it defines the total for
257 the entire cloud. (default: null)
258 :SANDBOX_CAP: Total number of instances of this type that is available for
259 use at one time. When defined in clouds.cfg it defines the total for
260 the entire cloud. This applies to "sandbox" systems and overrides the
261 INSTANCE_CAP setting. (default: null)
262 :FLOATING_IP_POOL: Floating ip pool to use. (default: "")
263 :SECURITY_GROUPS: Security group to use. (default: "default")
264 :AVAILABILITY_ZONE: OpenStack availability zone to use. (default: "")
265 :START_TIMEOUT: Number of milliseconds to wait for agent provisioning.
267 :KEY_PAIR_NAME: SSH Public Key Pair to use for authentication.
268 (default: jenkins-ssh)
269 :NUM_EXECUTORS: Number of executors to enable for the instance.
271 :JVM_OPTIONS: JVM Options to pass to Java. (default: null)
272 :FS_ROOT: File system root for the workspace. (default: "/w")
273 :NODE_PROPERTIES: Node properties. (default: null)
274 :RETENTION_TIME: Number of minutes to wait for an idle minion before
275 removing it from the system. If set to -1, the minion will stick around
276 forever. (default: 0)
277 :CONNECTION_TYPE: The connection type for Jenkins to connect to the build
278 minion. Valid options: JNLP, SSH. (default: "SSH")
279 :CONFIG_TYPE: Configuration drive. (default: null)
281 For a live example see the OpenDaylight project jenkins-config directory.
282 https://github.com/opendaylight/releng-builder/tree/master/jenkins-config
287 :Cloud Configuration:
289 The directory ``groovy-inserts`` contains the groovy script output used by
290 Jenkins to push the cloud configuration. In the event of a job failure use
294 .. _lf-global-jjb-jenkins-cfg-verify:
296 Jenkins Configuration Verify
297 ----------------------------
299 Jenkins job to verify the Global Jenkins configuration.
301 Requires the ``clouds-yaml`` file to be setup on the Jenkins host.
305 - {project-name}-jenkins-cfg-verify
306 - gerrit-jenkins-cfg-verify
307 - github-jenkins-cfg-verify
309 :Optional parameters:
311 :branch: Git branch to build against. (default: master)
312 :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
314 This job is not part of the "{project-name}-ci-jobs" group and requires
315 separate configuration.
319 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-verify.yaml
323 .. _jenkins-sandbox-cleanup:
325 Jenkins Sandbox Cleanup
326 -----------------------
328 Cleanup Jenkins Sandbox of jobs and views periodically.
332 - {project-name}-jenkins-sandbox-cleanup
333 - gerrit-jenkins-sandbox-cleanup
334 - github-jenkins-sandbox-cleanup
336 :Comment Trigger: NONE
338 :Required parameters:
340 :build-node: The node to run build on.
341 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
344 :Optional parameters:
346 :cron: Schedule to run job. (default: '0 8 * * 6')
354 Deploy jobs to jenkins-sandbox system via code review comment.
356 This job checks out the current code review patch and then runs a
357 ``jenkins-jobs update`` to push a patch defined by the comment.
361 - {project-name}-jjb-deploy-job
362 - gerrit-jjb-deploy-job
363 - github-jjb-deploy-job
365 :Comment Trigger: jjb-deploy JOB_NAME
369 The JJB Deploy Job is a manual job and triggers via Gerrit comment
370 which starts with the ``jjb-deploy`` keyword.
372 Example of a valid command in Gerrit comment that triggers the job:
374 ``jjb-deploy builder-jjb-*``
376 Example of a invalid command in Gerrit comment that would _not_ trigger
379 ``Update the job. jjb-deploy builder-jjb-*``
381 JOB_NAME can include the ``*`` wildcard character to push jobs matching
382 the pattern. For example ``jjb-deploy builder-jjb-*`` will push all
383 builder-jjb-* jobs to the sandbox system.
385 :Required parameters:
387 :build-node: The node to run build on.
388 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
391 :Optional parameters:
393 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
394 :gerrit_jjb_deploy_job_triggers: Override Gerrit Triggers.
402 Runs ``jenkins-jobs update`` to update production job configuration
405 - {project-name}-jjb-merge
409 :Comment Trigger: remerge
411 :Required parameters:
413 :build-node: The node to run build on.
414 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
417 :Optional parameters:
419 :branch: Git branch to fetch for the build. (default: master)
420 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
421 :build-timeout: Timeout in minutes before aborting build. (default: 10)
422 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
423 :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
424 :jjb-workers: Number of threads to run **update** with. Set to 0 by default
425 which will use the number of available CPU cores. (default: 0)
426 :jjb-version: JJB version to install. (default: see job-template)
427 :stream: Keyword that represents a release code-name.
428 Often the same as the branch. (default: master)
429 :submodule-recursive: Whether to checkout submodules recursively.
431 :submodule-timeout: Timeout (in minutes) for checkout operation.
433 :submodule-disable: Disable submodule checkout operation.
436 :gerrit_merge_triggers: Override Gerrit Triggers.
437 :gerrit_trigger_file_paths: Override file paths to filter which file
438 modifications will trigger a build.
439 (default defined by lf_jjb_common)
447 Runs ``jenkins-jobs test`` to verify JJB syntax. Optionally verifies
448 build-node labels used in templates and job definitions.
451 - {project-name}-jjb-verify
455 :Comment Trigger: recheck|reverify
457 :Required parameters:
459 :build-node: The node to run build on.
460 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
463 :Optional parameters:
465 :branch: Git branch to fetch for the build. (default: master)
466 :build-concurrent: Set to ``true`` to allow this job to run jobs
467 simultaneously. (default: true)
468 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
469 :build-node-label-check: Whether to check build-node labels in jobs
470 against node names in cloud config files (default: false)
471 :build-node-label-list: Space-separated list of external build-node
472 labels not present in cloud config files (default: "")
473 :build-timeout: Timeout in minutes before aborting build. (default: 10)
474 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
475 :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
476 :jjb-version: JJB version to install. (default: see job-template)
477 :stream: Keyword that represents a release code-name.
478 Often the same as the branch. (default: master)
479 :submodule-recursive: Set to ``true`` to checkout submodules recursively.
481 :submodule-timeout: Timeout (in minutes) for checkout operation.
483 :submodule-disable: Disable submodule checkout operation.
485 :throttle_categories: List of categories to throttle by.
486 :throttle-enabled: Set to ``true`` to enable throttling on the job.
488 :throttle-max-per-node: Max jobs to run on the same node. (default: 1)
489 :throttle-max-total: Max jobs to run across the entire project. - 0
490 means 'unlimited' (default: 0)
491 :throttle-option: Throttle by the project or by list of categories
492 defined in the throttle plugin configuration. (options: 'project',
493 'category'; default: project)
495 :gerrit_verify_triggers: Override Gerrit Triggers.
496 :gerrit_trigger_file_paths: Override file paths to filter which file
497 modifications will trigger a build.
498 (default defined by lf_jjb_common)
500 .. _jjb-verify-upstream-gjjb:
502 JJB Verify Upstream Global JJB
503 ------------------------------
505 Runs ``jenkins-jobs test`` to verify JJB syntax for upstream global-jjb
506 patches. This job is useful to notify upstream that they may be breaking
510 - {project-name}-jjb-verify-upstream-gjjb
511 - gerrit-jjb-verify-upstream-gjjb
512 - github-jjb-verify-upstream-gjjb
514 :Comment Trigger: recheck|reverify
516 :Required parameters:
518 :build-node: The node to run build on.
519 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
522 :Optional parameters:
524 :branch: Git branch to fetch for the build. (default: master)
525 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
526 :build-timeout: Timeout in minutes before aborting build. (default: 10)
527 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
528 :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
529 :jjb-version: JJB version to install. (default: see job-template)
530 :stream: Keyword that represents a release code-name.
531 Often the same as the branch. (default: master)
533 .. _info-yaml-verify:
538 This job verifies that ``INFO.yaml`` file changes follow the schema defined in
539 `lfit/releng-global-jjb/schema/info-schema.yaml`.
541 The ``INFO.yaml`` file changes must be independent of any other files changes.
544 - {project-name}-info-yaml-verify
545 - gerrit-info-yaml-verify
546 - github-info-yaml-verify
548 :Required parameters:
550 :build-node: The node to run build on.
551 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
554 :Optional parameters:
556 :branch: Git branch to fetch for the build. (default: master)
557 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
558 :build-timeout: Timeout in minutes before aborting build. (default: 10)
559 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
560 :stream: Keyword that represents a release code-name.
561 Often the same as the branch. (default: master)
562 :submodule-recursive: Whether to checkout submodules recursively.
564 :submodule-timeout: Timeout (in minutes) for checkout operation.
566 :submodule-disable: Disable submodule checkout operation.
569 :gerrit_verify_triggers: Override Gerrit Triggers.
571 .. _lf_pipelines_verify:
576 Verify job for the LF RelEng pipeline library.
578 Requires the Pipelines plugins installed. This job will look for a Gerrit
579 system named "lf-releng" (mapped to https://gerrit.linuxfoundation.org/infra/),
580 and pull in the Jenkinsfile in the root directory of the repo.
583 - lf-pipelines-verify
585 :Comment Trigger: recheck|reverify
592 Job to scan projects for files missing license headers.
595 - {project-name}-license-check
596 - gerrit-license-check
597 - github-license-check
599 :Optional parameters:
601 :build-timeout: Timeout in minutes before aborting build. (default: 15)
602 :file-patterns: Space-separated list of file patterns to scan.
603 (default: \*.go \*.groovy \*.java \*.py \*.sh)
604 :spdx-disable: Disable the SPDX-Identifier checker. (default: false)
605 :lhc-version: Version of LHC to use. (default: 0.2.0)
606 :license-exclude-paths: Comma-separated list of paths to exclude from the
607 license checker. Matches the paths defined here using a contains rule,
608 we recommend you to configure as precisely as possible. For example
609 a path of '/src/generated/' will search as '**/src/generated/**'.
610 Example: org/opendaylight/yang/gen,protobuff/messages
612 :licenses-allowed: Comma-separated list of allowed licenses.
613 (default: Apache-2.0,EPL-1.0,MIT)
614 :project-pattern: The ANT based pattern for Gerrit Trigger to choose which
615 projects to trigger job against. (default: '**')
617 .. _gjjb-openstack-cron:
622 Cron job that runs on a schedule to perform periodic tasks against OpenStack.
624 This job requires a Config File Provider file named ``clouds-yaml`` available
625 containing the credentials for the cloud.
628 - {project-name}-openstack-cron
629 - gerrit-openstack-cron
630 - github-openstack-cron
632 :Required parameters:
634 :build-node: The node to run build on.
635 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
637 :jenkins-urls: URLs to Jenkins systems to check for active builds.
639 :Optional parameters:
641 :branch: Git branch to fetch for the build. (default: master)
642 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
643 :build-timeout: Timeout in minutes before aborting build. (default: 90)
644 :cron: Time when the packer image should be rebuilt (default: @hourly)
645 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
646 :openstack-cloud: OS_CLOUD setting to pass to openstack client.
648 :openstack-image-cleanup: Set ``true`` to run the image cleanup script.
650 :openstack-image-cleanup-age: Age in days of image before marking it for
651 removal. (default: 30)
652 :openstack-image-protect: Set ``true`` to run the image protect script.
654 :openstack-server-cleanup: Set ``true`` to run the server cleanup script.
656 :openstack-stack-cleanup: Set ``true`` to run the stack cleanup script.
658 :openstack-volume-cleanup: Set ``true`` to run the volume cleanup script.
660 :stream: Keyword that represents a release code-name.
661 Often the same as the branch. (default: master)
662 :submodule-recursive: Whether to checkout submodules recursively.
664 :submodule-timeout: Timeout (in minutes) for checkout operation.
666 :submodule-disable: Disable submodule checkout operation.
671 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/openstack-cron-minimal.yaml
675 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/openstack-cron-full.yaml
677 .. _gjjb-openstack-update-cloud-image:
679 OpenStack Update Cloud Image
680 ----------------------------
682 This job finds and updates OpenStack cloud images on the ci-management source
685 This job functions in 2 ways:
687 1. When triggered via packer-merge job, updates the image created by the job.
688 2. When triggered manually or via cron, updates all images.
690 When triggered through an upstream packer merge job, this generates a change
691 request for the new image built.
693 When triggered manually, this job finds the latest images on OpenStack cloud
694 and compares them with the images in use in the source ci-management source
695 repository. If the compared images have newer time stamps are **all** updated
696 through a change request.
698 This job requires a Jenkins configuration merge and verify job setup and
702 - {project-name}-openstack-update-cloud-image
703 - gerrit-openstack-update-cloud-image
704 - github-openstack-update-cloud-image
706 :Required parameters:
708 :build-node: The node to run build on.
709 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
711 :new-image-name: Name of new image name passed from packer merge job or
712 set to 'all' to update all images. (default: all)
714 :Optional parameters:
716 :branch: Git branch to fetch for the build. (default: master)
717 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
718 :build-timeout: Timeout in minutes before aborting build. (default: 90)
719 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
720 :openstack-cloud: OS_CLOUD setting to pass to openstack client.
722 :stream: Keyword that represents a release code-name.
723 Often the same as the branch. (default: master)
724 :submodule-recursive: Whether to checkout submodules recursively.
726 :submodule-timeout: Timeout (in minutes) for checkout operation.
728 :submodule-disable: Disable submodule checkout operation.
730 :update-cloud-image: Submit a change request to update new built cloud
731 image to Jenkins. (default: false)
735 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/openstack-update-cloud-image-minimal.yaml
739 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/openstack-update-cloud-image-full.yaml
742 .. _gjjb-packer-merge:
747 Packer Merge job runs `packer build` to build system images in the cloud.
750 - {project-name}-packer-merge-{platforms}-{templates}
751 - gerrit-packer-merge
752 - github-packer-merge
754 :Comment Trigger: remerge
756 :Required parameters:
758 :build-node: The node to run build on.
759 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
761 :mvn-settings: The name of settings file containing credentials for
763 :platforms: Platform or distribution to build. Typically json file
764 found in the packer/vars directory. (Example: centos-7)
765 :templates: System template to build. Typically a yaml file or shell script
766 found in the packer/provision directory. (Example: docker)
768 :Optional parameters:
770 :cron: Time when the packer image should be rebuilt (default: @monthly)
771 :branch: Git branch to fetch for the build. (default: master)
772 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
773 :build-timeout: Timeout in minutes before aborting build. (default: 90)
774 :gerrit_verify_triggers: Override Gerrit Triggers.
775 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
776 :openstack: Packer template uses an OpenStack builder (default: true).
777 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
779 :packer-cloud-settings: Name of settings file containing credentials
780 for the cloud that packer will build on. (default: packer-cloud-env)
781 :packer-version: Version of packer to install / use in build. (default: 1.0.2)
782 :stream: Keyword that represents a release code-name.
783 Often the same as the branch. (default: master)
784 :submodule-recursive: Whether to checkout submodules recursively.
786 :submodule-timeout: Timeout (in minutes) for checkout operation.
788 :submodule-disable: Disable submodule checkout operation.
790 :update-cloud-image: Submit a change request to update newly built cloud
791 image to Jenkins. (default: false)
794 Test an in-progress patch
795 ^^^^^^^^^^^^^^^^^^^^^^^^^
797 To test an in-progress patch from a GitHub Pull Request, upload this
798 job to the :doc:`Jenkins Sandbox <lfdocs:jenkins-sandbox>`. Then when manually
799 building the job, replace the GERRIT_REFSPEC parameter with the GitHub Pull
800 Request number of the patch you would like to test.
806 GERRIT_REFSPEC: origin/pr/49/merge
809 .. _gjjb-packer-verify:
814 Packer Verify job runs ``packer validate`` to verify packer configuration. The
815 verify job checks superficial syntax of the template and other files. It does
816 not attempt to build an image, and cannot detect all possible build issues.
819 - {project-name}-packer-verify
820 - gerrit-packer-verify
821 - github-packer-verify
823 :Comment Trigger: recheck|reverify
825 :Required parameters:
827 :build-node: The node to run build on.
828 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured
830 :mvn-settings: The name of settings file containing credentials for
833 :Optional parameters:
835 :branch: Git branch to fetch for the build. (default: master)
836 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
837 :build-timeout: Timeout in minutes before aborting build. (default: 10)
838 :gerrit_trigger_file_paths: Override file paths to filter which file
839 modifications will trigger a build.
840 :gerrit_verify_triggers: Override Gerrit Triggers.
841 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
842 :openstack: Packer template uses an OpenStack builder (default: true).
843 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
845 :packer-cloud-settings: Name of settings file containing credentials
846 for the cloud that packer will build on. (default: packer-cloud-env)
847 :packer-version: Version of packer to install / use in build. (default: 1.0.2)
848 :stream: Keyword that represents a release code-name.
849 Often the same as the branch. (default: master)
850 :submodule-recursive: Whether to checkout submodules recursively.
852 :submodule-timeout: Timeout (in minutes) for checkout operation.
854 :submodule-disable: Disable submodule checkout operation.
858 .. _gjjb-packer-verify-build:
863 Packer Verify Build job is essentially the same as the
864 :ref:`Packer Merge job <gjjb-packer-merge>`. Trigger using its keyword,
865 and will build a useable image. If the last patch set before a merge has a
866 successful verify build, the merge job will not build the same image.
869 - {project-name}-packer-verify-build-{platforms}-{templates}
870 - gerrit-packer-verify-build
871 - github-packer-verify-build
873 :Comment Trigger: verify-build|packer-build
875 :Required parameters:
877 :build-node: The node to run build on.
878 :jenkins-ssh-credential: Credential to use for SSH. (Generally configured in
880 :mvn-settings: The name of settings file containing credentials for
882 :platforms: Platform or distribution to build. Typically json file
883 found in the packer/vars directory. (Example: centos-7)
884 :templates: System template to build. Typically a yaml file or shell script
885 found in the packer/provision directory. (Example: docker)
887 :Optional parameters:
889 :branch: Git branch to fetch for the build. (default: master)
890 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
891 :build-timeout: Timeout in minutes before aborting build. (default: 10)
892 :gerrit_trigger_file_paths: Override file paths to filter which file
893 modifications will trigger a build.
894 :gerrit_verify_triggers: Override Gerrit Triggers.
895 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
896 :openstack: Packer template uses an OpenStack builder (default: true).
897 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
899 :packer-cloud-settings: Name of settings file containing credentials
900 for the cloud that packer will build on. (default: packer-cloud-env)
901 :packer-version: Version of packer to install / use in build. (default: 1.0.2)
902 :stream: Keyword that represents a release code-name.
903 Often the same as the branch. (default: master)
904 :submodule-recursive: Whether to checkout submodules recursively.
906 :submodule-timeout: Timeout (in minutes) for checkout operation.
908 :submodule-disable: Disable submodule checkout operation.
910 :update-cloud-image: Submit a change request to update new built cloud
911 image to Jenkins. (default: false)
917 Runs puppet-lint in the ``puppet-dir`` directory. Since ``puppet-lint`` runs
918 recursively, we recommend to run from the base directory.
922 - {project-name}-puppet-verify
923 - gerrit-puppet-verify
924 - github-puppet-verify
926 :Comment Trigger: recheck|reverify
928 :Required Parameters:
930 :build-node: The node to run build on.
931 :jenkins-ssh-credential: Credential to use for SSH. (Generally set
934 :Optional Parameters:
936 :branch: The branch to build against. (default: master)
937 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
938 :build-timeout: Timeout in minutes before aborting build. (default: 15)
939 :gerrit_trigger_file_paths: Override file paths which used to filter which
940 file modifications will trigger a build. Refer to JJB documentation for
942 https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
943 :git-url: URL clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
944 :puppet-dir: Directory containing the project's puppet module(s) relative
947 :puppet-lint-version: Version of puppet-lint to use for testing.
949 :stream: Keyword representing a release code-name.
950 Often the same as the branch. (default: master)
951 :submodule-recursive: Whether to checkout submodules recursively.
953 :submodule-timeout: Timeout (in minutes) for checkout operation.
955 :submodule-disable: Disable submodule checkout operation.
962 Runs the Jenkins SonarQube Scanner plug-in to analyze code for bugs,
963 code smells and security vulnerabilities, and to upload the result
964 (possibly including code-coverage statistics) to a SonarQube server
967 Requires ``SonarQube Scanner for Jenkins``
969 Configuration must set one of the parameters ``sonar-project-file`` or
970 ``sonar-properties``; they cannot both be empty.
972 Plug-in configurations
973 Manage Jenkins --> Configure System --> SonarQube servers
974 - Name: Sonar (fixed)
975 - Server URL: https://sonar.server.org/ or https://sonarcloud.io
976 - Server authentication token: none for local, API token (saved as a
977 "secret text" credential) for Sonarcloud
979 Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner
980 - Name: SonarQube Scanner (fixed)
981 - Install automatically
982 - Select latest version
986 Optionally, set Sonar properties directly in the job definition by
987 setting the sonar-project-file to ``""`` and adding all properties under
988 ``sonar-properties``.
992 - {project-name}-sonar
996 :Optional Parameters:
997 :sonar-task: Sonar task to run. (default: "")
998 :sonar-project-file: The filename for the project's properties
999 (default: "sonar-project.properties")
1000 :sonar-properties: Sonar configuration properties. (default: "")
1001 :sonar-java-opts: JVM options. (default: "")
1002 :sonar-additional-args: Additional command line arguments. (default: "")
1008 The same as the Sonar job above, except the caller also defines a builder
1009 called ``lf-sonar-prescan``, in which they can put any builders that they want
1010 to run before the Sonar scan.
1012 .. code-block:: yaml
1015 name: lf-sonar-prescan
1017 - shell: "# Pre-scan shell script"
1021 - {project-name}-sonar-prescan
1022 - gerrit-sonar-prescan
1023 - github-sonar-prescan
1025 :Required Parameters:
1026 :lf-sonar-prescan: A builder that will run before the Sonar scan.
1028 :Optional Parameters:
1029 :sonar-task: Sonar task to run. (default: "")
1030 :sonar-project-file: The filename for the project's properties
1031 (default: "sonar-project.properties")
1032 :sonar-properties: Sonar configuration properties. (default: "")
1033 :sonar-java-opts: JVM options. (default: "")
1034 :sonar-additional-args: Additional command line arguments. (default: "")
1037 Sonar with Prescan Script
1038 -------------------------
1040 The same as the Sonar job above, except the caller must supply a shell script
1041 to run before the Sonar scan. This is commonly used to install prerequisites,
1042 build the project, execute unit tests and generate a code-coverage report.
1046 - {project-name}-sonar-prescan-script
1047 - gerrit-sonar-prescan-script
1048 - github-sonar-prescan-script
1050 :Required Parameters:
1051 :sonar-prescan-script: A shell script that will run before the Sonar scan.
1053 :Optional Parameters:
1054 :sonar-task: Sonar task to run. (default: "")
1055 :sonar-project-file: The filename for the project's properties.
1056 (default: "sonar-project.properties")
1057 :sonar-properties: Sonar configuration properties. (default: "")
1058 :sonar-java-opts: JVM options. (default: "")
1059 :sonar-additional-args: Additional command line arguments. (default: "")