Add Sonar plug-in configurations to docs
[releng/global-jjb.git] / docs / jjb / lf-ci-jobs.rst
1 #######
2 CI Jobs
3 #######
4
5 Job Groups
6 ==========
7
8 .. include:: ../job-groups.rst
9
10 Below is a list of CI job groups:
11
12 .. literalinclude:: ../../jjb/lf-ci-job-groups.yaml
13    :language: yaml
14
15
16 Macros
17 ======
18
19 lf-infra-jjb-parameters
20 -----------------------
21
22 :Required Parameters:
23
24     :jjb-cache: Location of Jenkins Job Builder (JJB) cache used for jjb
25         jobs.
26     :jjb-version: Version of Jenkins Job Builder (JJB) to install and use in
27         the jjb jobs.
28
29 lf-jenkins-cfg-clouds
30 ---------------------
31
32 Deploys Jenkins Cloud configuration read from the ``jenkins-clouds`` directory
33 in ci-management repositories.
34
35 .. note::
36
37    Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
38    config definitions for "production" and "sandbox" systems.
39
40 :Required Parameters:
41
42     :jenkins-silos: Space-separated list of Jenkins silos to update
43         configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
44
45 lf-jenkins-cfg-global-vars
46 --------------------------
47
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.
51
52 .. note::
53
54    Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
55    config definitions for "production" and "sandbox" systems.
56
57 :Required parameters:
58
59     :jenkins-silos: Space-separated list of Jenkins silos to update
60         configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
61
62 lf-infra-jjbini
63 ---------------
64
65 Provides jenkins_jobs.ini configuration for Jenkins.
66
67 lf-packer-common
68 ----------------
69
70 Common packer configuration.
71
72 lf-packer-file-paths
73 --------------------
74
75 Gerrit file-paths for packer jobs.
76
77 lf-packer-parameters
78 --------------------
79
80 Parameters useful for packer related tasks.
81
82 :Parameters:
83
84     :packer-version: Version of packer to install / use.
85         (shell: PACKER_VERSION)
86
87 lf-packer-verify-file-paths
88 ---------------------------
89
90 Gerrit file-paths for packer verify jobs.
91
92 lf-puppet-parameters
93 --------------------
94
95 Parameters useful for Puppet related tasks.
96
97 :Parameters:
98
99     :puppet-lint-version: Version of puppet-lint to install / use.
100         (shell: PUPPET_LINT_VERSION)
101
102 Job Templates
103 =============
104
105 .. _gerrit-branch-lock:
106
107 Gerrit Branch Lock
108 ------------------
109
110 Job submits a patch to lock or unlock a project's branch.
111
112 :Template Names:
113     - {project-name}-gerrit-branch-lock-{stream}
114     - gerrit-branch-lock
115
116 :Comment Trigger:
117
118     * lock branch
119     * unlock branch
120
121 :Required parameters:
122
123     :build-node: The node to run build on.
124     :jenkins-ssh-credential: Credential to use for SSH. (Generally
125         should be configured in defaults.yaml)
126
127 :Optional parameters:
128
129     :branch: Git branch to build against. (default: master)
130     :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
131     :stream: Keyword that can be used to represent a release code-name.
132         Often the same as the branch. (default: master)
133     :submodule-timeout: Timeout (in minutes) for checkout operation.
134         (default: 10)
135     :submodule-disable: Disable submodule checkout operation.
136         (default: false)
137     :gerrit_merge_triggers: Override Gerrit Triggers.
138
139 .. _lf-global-jjb-jenkins-cfg-merge:
140
141 Jenkins Configuration Merge
142 ---------------------------
143
144 Jenkins job to manage Global Jenkins configuration.
145
146 .. note::
147
148    Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
149    config definitions for "production" and "sandbox" systems.
150
151 :Template names:
152
153     - {project-name}-jenkins-cfg-merge
154     - gerrit-jenkins-cfg-merge
155     - github-jenkins-cfg-merge
156
157 :Optional parameters:
158
159     :branch: Git branch to build against. (default: master)
160     :cron: How often to run the job on a cron schedule. (default: @daily)
161     :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
162     :jenkins-silos: Space separated list of Jenkins silos to update
163         configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
164         (default: production sandbox)
165
166 Typically this template is automatically pulled in by the
167 "{project-name}-ci-jobs" job-group and does not need to be explicitly called if
168 the job group is being used.
169
170 Minimal Example:
171
172 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml
173    :language: yaml
174
175 Full Example:
176
177 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-merge-full.yaml
178    :language: yaml
179
180 .. _jenkins-cfg-envvar:
181
182 Global Environment Variables
183 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
184
185 Global Environment Variables are managed via the
186 ``jenkins-config/global-vars-SILO.sh`` file in ci-management. Replace SILO with
187 the name of the Jenkins silo the variable configuration is for.
188
189 The format for this file is ``KEY=value`` for example::
190
191     GERRIT_URL=https://git.opendaylight.org/gerrit
192     GIT_BASE=git://devvexx.opendaylight.org/mirror/$PROJECT
193     GIT_URL=git://devvexx.opendaylight.org/mirror
194     JENKINS_HOSTNAME=vex-yul-odl-jenkins-2
195     LOGS_SERVER=https://logs.opendaylight.org
196     NEXUS_URL=https://nexus.opendaylight.org
197     ODLNEXUSPROXY=https://nexus.opendaylight.org
198     SILO=sandbox
199     SONAR_URL=https://sonar.opendaylight.org
200
201 Cloud Configuration
202 ^^^^^^^^^^^^^^^^^^^
203
204 This configuration requires the OpenStack Cloud plugin in Jenkins and is
205 currently the only cloud plugin supported.
206
207 OpenStack Cloud plugin version supported:
208
209 * 2.30 - 2.34
210 * 2.35 - 2.37
211
212 Cloud configuration are managed via a directory structure in ci-management as
213 follows:
214
215 - jenkins-config/clouds/openstack/
216 - jenkins-config/clouds/openstack/cattle/cloud.cfg
217 - jenkins-config/clouds/openstack/cattle/centos7-builder-2c-2g.cfg
218 - jenkins-config/clouds/openstack/cattle/centos7-builder-4c-4g.cfg
219 - jenkins-config/clouds/openstack/cattle/centos7-docker-4c-4g.cfg
220
221 The directory name inside of the "openstack" directory is used as the name of
222 the cloud configuration. In this case "cattle" is being used as the cloud name.
223
224 The ``cloud.cfg`` file is a special file used to configure the main cloud
225 configuration in the format ``KEY=value``.
226
227 :Cloud Parameters:
228
229     :CLOUD_URL: API endpoint URL for Keystone.
230         (default: "")
231     :CLOUD_IGNORE_SSL: Ignore unverified SSL certificates. (default: false)
232     :CLOUD_ZONE: OpenStack region to use. (default: "")
233     :CLOUD_CREDENTIAL_ID: Credential to use for authentication to OpenStack.
234         (default: "os-cloud")
235     :INSTANCE_CAP: Total number of instances the cloud will allow spin up.
236         (default: null)
237     :SANDBOX_CAP: Total number of instances the cloud will allow to
238         spin up. This applies to "sandbox" systems and overrides the
239         INSTANCE_CAP setting. (default: null)
240
241 :Template Parameters:
242
243     .. note::
244
245        In the case of template definitions of a parameter below is not passed
246        the one defined in default clouds will be inherited.
247
248     :IMAGE_NAME: The image name to use for this template.
249         (required)
250     :HARDWARE_ID: OpenStack flavor to use. (required)
251
252     :LABELS: Labels to assign to the vm. (default: FILE_NAME)
253     :NETWORK_ID: OpenStack network to use. (default: "")
254     :USER_DATA_ID: User Data to pass into the instance.
255         (default: jenkins-init-script)
256     :INSTANCE_CAP: Total number of instances of this type that can be launched
257         at one time. When defined in clouds.cfg it defines the total for the
258         entire cloud. (default: null)
259     :SANDBOX_CAP: Total number of instances of this type that can be launched
260         at one time. When defined in clouds.cfg it defines the total for the
261         entire cloud. This applies to "sandbox" systems and overrides the
262         INSTANCE_CAP setting. (default: null)
263     :FLOATING_IP_POOL: Floating ip pool to use. (default: "")
264     :SECURITY_GROUPS: Security group to use. (default: "default")
265     :AVAILABILITY_ZONE: OpenStack availability zone to use. (default: "")
266     :START_TIMEOUT: Number of milliseconds to wait for the agent to be
267         provisioned and connected. (default: 600000)
268     :KEY_PAIR_NAME: SSH Public Key Pair to use for authentication.
269         (default: jenkins)
270     :NUM_EXECUTORS: Number of executors to enable for the instance.
271         (default: 1)
272     :JVM_OPTIONS: JVM Options to pass to Java. (default: "")
273     :FS_ROOT: File system root for the workspace. (default: "/w")
274     :RETENTION_TIME: Number of minutes to wait for an idle slave to be used
275         again before it's removed. If set to -1, the slave will be kept
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
280 For a live example see the OpenDaylight project jenkins-config directory.
281 https://github.com/opendaylight/releng-builder/tree/master/jenkins-config
282
283 Troubleshooting
284 ^^^^^^^^^^^^^^^
285
286 :Cloud Configuration:
287
288     The directory ``groovy-inserts`` contains the groovy script output that is
289     used to push to Jenkins. In the event of a job failure this file can be
290     inspected.
291
292  .. _lf-global-jjb-jenkins-cfg-verify:
293
294 Jenkins Configuration Verify
295 ----------------------------
296
297 Jenkins job to verify the Global Jenkins configuration.
298
299 Requires the ``clouds-yaml`` file to be setup on the Jenkins host.
300
301 :Template names:
302
303     - {project-name}-jenkins-cfg-verify
304     - gerrit-jenkins-cfg-verify
305     - github-jenkins-cfg-verify
306
307 :Optional parameters:
308
309     :branch: Git branch to build against. (default: master)
310     :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
311
312 This job is not part of the "{project-name}-ci-jobs" group. It must be called
313 explicitly.
314
315 Example:
316
317 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-verify.yaml
318    :language: yaml
319
320
321 .. _jenkins-sandbox-cleanup:
322
323 Jenkins Sandbox Cleanup
324 -----------------------
325
326 Cleanup Jenkins Sandbox of jobs and views periodically.
327
328 :Template names:
329
330     - {project-name}-jenkins-sandbox-cleanup
331     - gerrit-jenkins-sandbox-cleanup
332     - github-jenkins-sandbox-cleanup
333
334 :Comment Trigger: NONE
335
336 :Required parameters:
337
338     :build-node: The node to run build on.
339     :jenkins-ssh-credential: Credential to use for SSH. (Generally
340         should be configured in defaults.yaml)
341
342 :Optional parameters:
343
344     :cron: Schedule to run job. (default: '0 8 * * 6')
345
346
347 .. _jjb-deploy:
348
349 JJB Deploy Job
350 --------------
351
352 Deploy jobs to jenkins-sandbox system via code review comment.
353
354 This job checks out the current code review patch and then runs a
355 ``jenkins-jobs update`` to push a patch defined by the comment.
356
357 :Template names:
358
359     - {project-name}-jjb-deploy-job
360     - gerrit-jjb-deploy-job
361     - github-jjb-deploy-job
362
363 :Comment Trigger: jjb-deploy JOB_NAME
364
365     .. note::
366
367        The JJB Deploy Job is configured to trigger only if the Gerrit comment
368        starts with the `jjb-deploy` keyword.
369
370        Example of a valid command in Gerrit comment that triggers the job:
371
372        ``jjb-deploy builder-jjb-*``
373
374        Example of a invalid command in Gerrit comment that would _not_ trigger
375        the job:
376
377        ``Update the job. jjb-deploy builder-jjb-*``
378
379        JOB_NAME can include the * wildcard character to push multiple jobs
380        matching the pattern. For example ``jjb-deploy builder-jjb-*`` will push
381        all builder-jjb-* jobs to the sandbox system.
382
383 :Required parameters:
384
385     :build-node: The node to run build on.
386     :jenkins-ssh-credential: Credential to use for SSH. (Generally
387         should be configured in defaults.yaml)
388
389 :Optional parameters:
390
391     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
392     :gerrit_jjb_deploy_job_triggers: Override Gerrit Triggers.
393
394
395 .. _jjb-merge:
396
397 JJB Merge
398 ---------
399
400 Runs `jenkins-jobs update` to update production job configuration
401
402 :Template Names:
403     - {project-name}-jjb-merge
404     - gerrit-jjb-merge
405     - github-jjb-merge
406
407 :Comment Trigger: remerge
408
409 :Required parameters:
410
411     :build-node: The node to run build on.
412     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
413         be configured in defaults.yaml)
414
415 :Optional parameters:
416
417     :branch: Git branch to fetch for the build. (default: master)
418     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
419     :build-timeout: Timeout in minutes before aborting build. (default: 10)
420     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
421     :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
422     :jjb-workers: Number of threads to run **update** with. Set to 0 by default
423         which is equivalent to the number of available CPU cores. (default: 0)
424     :jjb-version: JJB version to install. (default: see job-template)
425     :stream: Keyword that can be used to represent a release code-name.
426         Often the same as the branch. (default: master)
427     :submodule-recursive: Whether to checkout submodules recursively.
428         (default: true)
429     :submodule-timeout: Timeout (in minutes) for checkout operation.
430         (default: 10)
431     :submodule-disable: Disable submodule checkout operation.
432         (default: false)
433
434     :gerrit_merge_triggers: Override Gerrit Triggers.
435     :gerrit_trigger_file_paths: Override file paths which can be used to
436         filter which file modifications will trigger a build.
437         (default defined by lf_jjb_common)
438
439
440 .. _jjb-verify:
441
442 JJB Verify
443 ----------
444
445 Runs `jenkins-jobs test` to validate JJB syntax
446
447 :Template Names:
448     - {project-name}-jjb-verify
449     - gerrit-jjb-verify
450     - github-jjb-verify
451
452 :Comment Trigger: recheck|reverify
453
454 :Required parameters:
455
456     :build-node: The node to run build on.
457     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
458         be configured in defaults.yaml)
459
460 :Optional parameters:
461
462     :branch: Git branch to fetch for the build. (default: master)
463     :build-concurrent: Whether or not to allow this job to run multiple jobs
464         simultaneously. (default: true)
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     :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
469     :jjb-version: JJB version to install. (default: see job-template)
470     :stream: Keyword that can be used to represent a release code-name.
471         Often the same as the branch. (default: master)
472     :submodule-recursive: Whether to checkout submodules recursively.
473         (default: true)
474     :submodule-timeout: Timeout (in minutes) for checkout operation.
475         (default: 10)
476     :submodule-disable: Disable submodule checkout operation.
477         (default: false)
478     :throttle_categories: List of categories to throttle by.
479     :throttle-enabled: Whether or not to enable throttling on the job.
480         (default: true)
481     :throttle-max-per-node: Max jobs to run on the same node. (default: 1)
482     :throttle-max-total: Max jobs to run across the entire project. - 0
483         means 'unlimited' (default: 0)
484     :throttle-option: Throttle by the project or by list of categories
485         defined in the throttle plugin configuration. (options: 'project',
486         'category'; default: project)
487
488     :gerrit_verify_triggers: Override Gerrit Triggers.
489     :gerrit_trigger_file_paths: Override file paths which can be used to
490         filter which file modifications will trigger a build.
491         (default defined by lf_jjb_common)
492
493 .. _jjb-verify-upstream-gjjb:
494
495 JJB Verify Upstream Global JJB
496 ------------------------------
497
498 Runs ``jenkins-jobs test`` to validate JJB syntax for upstream global-jjb
499 patches. This job is useful to notify upstream that they may be breaking
500 project level jobs.
501
502 :Template Names:
503     - {project-name}-jjb-verify-upstream-gjjb
504     - gerrit-jjb-verify-upstream-gjjb
505
506 :Comment Trigger: recheck|reverify
507
508 :Required parameters:
509
510     :build-node: The node to run build on.
511     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
512         be configured in defaults.yaml)
513
514 :Optional parameters:
515
516     :branch: Git branch to fetch for the build. (default: master)
517     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
518     :build-timeout: Timeout in minutes before aborting build. (default: 10)
519     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
520     :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs)
521     :jjb-version: JJB version to install. (default: see job-template)
522     :stream: Keyword that can be used to represent a release code-name.
523         Often the same as the branch. (default: master)
524
525 .. _info-yaml-verify:
526
527 Info YAML Verify
528 ----------------
529
530 Info YAML Verify job validates that INFO.yaml file changes are kept isolated from
531 other file changes. Verifies INFO.yaml files follow the schema defined in
532 `lfit/releng-global-jjb/schema/info-schema.yaml`.
533
534 :Template Names:
535     - {project-name}-info-yaml-verify
536     - gerrit-info-yaml-verify
537     - github-info-yaml-verify
538
539 :Required parameters:
540
541     :build-node: The node to run build on.
542     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
543         be configured in defaults.yaml)
544
545 :Optional parameters:
546
547     :branch: Git branch to fetch for the build. (default: master)
548     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
549     :build-timeout: Timeout in minutes before aborting build. (default: 10)
550     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
551     :stream: Keyword that can be used to represent a release code-name.
552         Often the same as the branch. (default: master)
553     :submodule-recursive: Whether to checkout submodules recursively.
554         (default: true)
555     :submodule-timeout: Timeout (in minutes) for checkout operation.
556         (default: 10)
557     :submodule-disable: Disable submodule checkout operation.
558         (default: false)
559
560     :gerrit_verify_triggers: Override Gerrit Triggers.
561
562 .. _license-checker:
563
564 License Checker
565 ---------------
566
567 Job to scan projects for files missing license headers.
568
569 :Template Names:
570     - {project-name}-license-check
571     - gerrit-license-check
572     - github-license-check
573
574 :Optional parameters:
575
576     :build-timeout: Timeout in minutes before aborting build. (default: 15)
577     :file-patterns: Space-separated list of file patterns to scan.
578         (default: \*.go \*.groovy \*.java \*.py \*.sh)
579     :spdx-disable: Disable the SPDX-Identifier checker. (default: false)
580     :lhc-version: Version of LHC to use. (default: 0.2.0)
581     :license-exclude-paths: Comma-separated list of paths to exclude from the
582         license checker. The paths used here will be matched using a contains
583         rule so it is best to be as precise with the path as possible.
584         For example a path of '/src/generated/' will be searched as
585         '**/src/generated/**'.
586         Example: org/opendaylight/yang/gen,protobuff/messages
587         (default: '')
588     :licenses-allowed: Comma-separated list of allowed licenses.
589         (default: Apache-2.0,EPL-1.0,MIT)
590     :project-pattern: The ANT based pattern for Gerrit Trigger to choose which
591         projects to trigger job against. (default: '**')
592
593 .. _gjjb-openstack-cron:
594
595 OpenStack Cron
596 --------------
597
598 Cron job that runs regularly to perform periodic tasks against OpenStack.
599
600 This job requires a Config File Provider file named ``clouds-yaml`` available
601 containing the credentials for the cloud.
602
603 :Template Names:
604     - {project-name}-openstack-cron
605     - gerrit-openstack-cron
606     - github-openstack-cron
607
608 :Required parameters:
609
610     :build-node: The node to run build on.
611     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
612         be configured in defaults.yaml)
613     :jenkins-urls: URLs to Jenkins systems to check for active builds.
614
615 :Optional parameters:
616
617     :branch: Git branch to fetch for the build. (default: master)
618     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
619     :build-timeout: Timeout in minutes before aborting build. (default: 90)
620     :cron: Time when the packer image should be rebuilt (default: @hourly)
621     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
622     :openstack-cloud: OS_CLOUD setting to pass to openstack client.
623         (default: vex)
624     :openstack-image-cleanup: Whether or not to run the image cleanup script.
625         (default: true)
626     :openstack-image-cleanup-age: Age in days of image before marking it for
627         removal. (default: 30)
628     :openstack-image-protect: Whether or not to run the image protect script.
629         (default: true)
630     :openstack-server-cleanup: Whether or not to run the server cleanup script.
631         (default: true)
632     :openstack-stack-cleanup: Whether or not to run the stack cleanup script.
633         (default: true)
634     :openstack-volume-cleanup: Whether or not to run the volume cleanup script.
635         (default: true)
636     :stream: Keyword that can be used to represent a release code-name.
637         Often the same as the branch. (default: master)
638     :submodule-recursive: Whether to checkout submodules recursively.
639         (default: true)
640     :submodule-timeout: Timeout (in minutes) for checkout operation.
641         (default: 10)
642     :submodule-disable: Disable submodule checkout operation.
643         (default: false)
644
645 Minimal Example:
646
647 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/openstack-cron-minimal.yaml
648
649 Full Example:
650
651 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/openstack-cron-full.yaml
652
653
654 .. _gjjb-packer-merge:
655
656 Packer Merge
657 ------------
658
659 Packer Merge job runs `packer build` to build system images in the cloud.
660
661 :Template Names:
662     - {project-name}-packer-merge-{platforms}-{templates}
663     - gerrit-packer-merge
664     - github-packer-merge
665
666 :Comment Trigger: remerge
667
668 :Required parameters:
669
670     :build-node: The node to run build on.
671     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
672         be configured in defaults.yaml)
673     :mvn-settings: The name of settings file containing credentials for
674         the project.
675     :platforms: Platform or distribution to build. Typically json file
676         found in the packer/vars directory. (Example: centos)
677     :template: System template to build. Typically shell script found in
678         the packer/provision directory. (Example: java-builder)
679
680 :Optional parameters:
681
682     :cron: Time when the packer image should be rebuilt (default: @monthly)
683     :branch: Git branch to fetch for the build. (default: master)
684     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
685     :build-timeout: Timeout in minutes before aborting build. (default: 90)
686     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
687     :openstack: Packer template uses an OpenStack builder (default: true).
688     :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
689         (default: vex).
690     :packer-cloud-settings: Name of settings file containing credentials
691         for the cloud that packer will build on. (default: packer-cloud-env)
692     :packer-version: Version of packer to install / use in build. (default: 1.0.2)
693     :stream: Keyword that can be used to represent a release code-name.
694         Often the same as the branch. (default: master)
695     :submodule-recursive: Whether to checkout submodules recursively.
696         (default: true)
697     :submodule-timeout: Timeout (in minutes) for checkout operation.
698         (default: 10)
699     :submodule-disable: Disable submodule checkout operation.
700         (default: false)
701
702     :gerrit_verify_triggers: Override Gerrit Triggers.
703
704 Test an in-progress patch
705 ^^^^^^^^^^^^^^^^^^^^^^^^^
706
707 To test an in-progress patch from a GitHub Pull Request. Upload this
708 job to the :doc:`Jenkins Sandbox <lfdocs:jenkins-sandbox>`. Then when manually
709 building the job replace the GERRIT_REFSPEC parameter with the GitHub Pull
710 Request number of the patch you would like to test.
711
712 Example GitHub:
713
714 .. code-block:: none
715
716    GERRIT_REFSPEC: origin/pr/49/merge
717
718 .. _gjjb-packer-verify:
719
720 Packer Verify
721 -------------
722
723 Packer Verify job runs `packer validate` to verify packer configuration.
724
725 :Template Names:
726     - {project-name}-packer-verify
727     - gerrit-packer-verify
728     - github-packer-verify
729
730 :Comment Trigger: recheck|reverify
731
732 :Required parameters:
733
734     :build-node: The node to run build on.
735     :jenkins-ssh-credential: Credential to use for SSH. (Generally should
736         be configured in defaults.yaml)
737     :mvn-settings: The name of settings file containing credentials for
738         the project.
739
740 :Optional parameters:
741
742     :branch: Git branch to fetch for the build. (default: master)
743     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
744     :build-timeout: Timeout in minutes before aborting build. (default: 10)
745     :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
746     :openstack: Packer template uses an OpenStack builder (default: true).
747     :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
748         (default: vex).
749     :packer-cloud-settings: Name of settings file containing credentials
750         for the cloud that packer will build on. (default: packer-cloud-env)
751     :packer-version: Version of packer to install / use in build. (default: 1.0.2)
752     :stream: Keyword that can be used to represent a release code-name.
753         Often the same as the branch. (default: master)
754     :submodule-recursive: Whether to checkout submodules recursively.
755         (default: true)
756     :submodule-timeout: Timeout (in minutes) for checkout operation.
757         (default: 10)
758     :submodule-disable: Disable submodule checkout operation.
759         (default: false)
760
761     :gerrit_verify_triggers: Override Gerrit Triggers.
762     :gerrit_trigger_file_paths: Override file paths which can be used to
763         filter which file modifications will trigger a build.
764
765
766 Puppet Verify
767 -------------
768
769 Runs puppet-lint in the ``puppet-dir`` directory. puppet-lint runs recursively,
770 the base directory is usually the best place to run from.
771
772 :Template Names:
773
774     - {project-name}-puppet-verify
775     - gerrit-puppet-verify
776     - github-puppet-verify
777
778 :Comment Trigger: recheck|reverify
779
780 :Required Parameters:
781
782     :build-node: The node to run build on.
783     :jenkins-ssh-credential: Credential to use for SSH. (Generally set
784         in defaults.yaml)
785
786 :Optional Parameters:
787
788     :branch: The branch to build against. (default: master)
789     :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
790     :build-timeout: Timeout in minutes before aborting build. (default: 15)
791     :gerrit_trigger_file_paths: Override file paths which used to filter which
792         file modifications will trigger a build. Refer to JJB documentation for
793         "file-path" details.
794         https://docs.openstack.org/infra/jenkins-job-builder/triggers.html#triggers.gerrit
795     :git-url: URL clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
796     :puppet-dir: Directory containing the project's puppet module(s) relative
797         to the workspace.
798         (default: '')
799     :puppet-lint-version: Version of puppet-lint to use for testing.
800         (default: 2.3.6)
801     :stream: Keyword representing a release code-name.
802         Often the same as the branch. (default: master)
803     :submodule-recursive: Whether to checkout submodules recursively.
804         (default: true)
805     :submodule-timeout: Timeout (in minutes) for checkout operation.
806         (default: 10)
807     :submodule-disable: Disable submodule checkout operation.
808         (default: false)
809
810
811 Sonar
812 -----
813
814 Runs Jenkins Sonarqube plug-in to review for bugs, code smells,
815 and security vulnerabilities.
816
817 Requires ``SonarQube Scanner for Jenkins``
818
819 Plug-in configurations
820     Manage Jenkins --> Configure System --> SonarQube servers
821         - Name: Sonar (fixed)
822         - Server URL: https://sonar.server.org/
823         - Server authentication token: none
824
825     Manage Jenkins --> Global Tool Configuration --> SonarQube Scanner
826         - Name: SonarQube Scanner (fixed)
827         - Install automatically
828         - Select latest version
829
830 :Template Names:
831
832     - {project-name}-sonar
833     - gerrit-sonar
834     - github-sonar
835
836 :Optional Parameters:
837     :sonar-task: Sonar task to run. (default: "")
838     :sonar-properties: Sonar configuration properties. (default: "")
839     :sonar-java-opts: JVM options. (default: "")
840     :sonar-additional-args: Additional command line arguments. (default: "")