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-version: Version of Jenkins Job Builder (JJB) to install and use in
30 Deploys Jenkins Cloud configuration read from the ``jenkins-clouds`` directory
31 in ci-management repositories.
35 Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
36 config definitions for "production" and "sandbox" systems.
40 :jenkins-silos: Space-separated list of Jenkins silos to update
41 configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
43 lf-jenkins-cfg-global-vars
44 --------------------------
46 Manages the Global Jenkins variables. This macro will clear all exist macros
47 in Jenkins and replaces them with the ones defined by the
48 ci-management/jenkins-config/global-vars-SILO.sh script.
52 Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
53 config definitions for "production" and "sandbox" systems.
57 :jenkins-silos: Space-separated list of Jenkins silos to update
58 configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
63 Provides jenkins_jobs.ini configuration for Jenkins.
65 lf-infra-jjbini-sandbox
66 -----------------------
68 Provides jenkins_jobs.ini configuration for Jenkins sandbox.
70 .. todo:: This needs to be consolidated into lf-infra-jjbini when JJB 2.0 is available
75 Common packer configuration.
80 Gerrit file-paths for packer jobs.
85 Parameters useful for packer related tasks.
89 :packer-version: Version of packer to install / use.
90 (shell: PACKER_VERSION)
92 lf-packer-verify-file-paths
93 ---------------------------
95 Gerrit file-paths for packer verify jobs.
100 .. _gerrit-branch-lock:
105 Job submits a patch to lock or unlock a project's branch.
108 - {project-name}-gerrit-branch-lock-{stream}
116 :Required parameters:
118 :build-node: The node to run build on.
119 :jenkins-ssh-credential: Credential to use for SSH. (Generally
120 should be configured in defaults.yaml)
122 :Optional parameters:
124 :branch: Git branch to build against. (default: master)
125 :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
126 :stream: Keyword that can be used to represent a release code-name.
127 Often the same as the branch. (default: master)
128 :submodule-timeout: Timeout (in minutes) for checkout operation.
130 :gerrit_merge_triggers: Override Gerrit Triggers.
132 .. _lf-global-jjb-jenkins-cfg-merge:
134 Jenkins Configuration Merge
135 ---------------------------
137 Jenkins job to manage Global Jenkins configuration.
141 Requires the jjbini file in Jenkins CFP to contain JJB 2.0 style
142 config definitions for "production" and "sandbox" systems.
146 - {project-name}-jenkins-cfg-merge
147 - gerrit-jenkins-cfg-merge
148 - github-jenkins-cfg-merge
150 :Optional parameters:
152 :branch: Git branch to build against. (default: master)
153 :cron: How often to run the job on a cron schedule. (default: @daily)
154 :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
155 :jenkins-silos: Space separated list of Jenkins silos to update
156 configuration for as defined in ~/.config/jenkins_jobs/jenkins_jobs.ini
157 (default: production sandbox)
159 Typically this template is automatically pulled in by the
160 "{project-name}-ci-jobs" job-group and does not need to be explicitly called if
161 the job group is being used.
165 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml
170 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-merge-full.yaml
173 .. _jenkins-cfg-envvar:
175 Global Environment Variables
176 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178 Global Environment Variables are managed via the
179 ``jenkins-config/global-vars-SILO.sh`` file in ci-management. Replace SILO with
180 the name of the Jenkins silo the variable configuration is for.
182 The format for this file is ``KEY=value`` for example::
184 GERRIT_URL=https://git.opendaylight.org/gerrit
185 GIT_BASE=git://devvexx.opendaylight.org/mirror/$PROJECT
186 GIT_URL=git://devvexx.opendaylight.org/mirror
187 JENKINS_HOSTNAME=vex-yul-odl-jenkins-2
188 LOGS_SERVER=https://logs.opendaylight.org
189 NEXUS_URL=https://nexus.opendaylight.org
190 ODLNEXUSPROXY=https://nexus.opendaylight.org
192 SONAR_URL=https://sonar.opendaylight.org
197 This configuration requires the OpenStack Cloud plugin in Jenkins and is
198 currently the only cloud plugin supported.
200 OpenStack Cloud plugin version supported:
205 Cloud configuration are managed via a directory structure in ci-management as
208 - jenkins-config/clouds/openstack/
209 - jenkins-config/clouds/openstack/cattle/cloud.cfg
210 - jenkins-config/clouds/openstack/cattle/centos7-builder-2c-2g.cfg
211 - jenkins-config/clouds/openstack/cattle/centos7-builder-4c-4g.cfg
212 - jenkins-config/clouds/openstack/cattle/centos7-docker-4c-4g.cfg
214 The directory name inside of the "openstack" directory is used as the name of
215 the cloud configuration. In this case "cattle" is being used as the cloud name.
217 The ``cloud.cfg`` file is a special file used to configure the main cloud
218 configuration in the format ``KEY=value``.
222 :CLOUD_URL: API endpoint URL for Keystone.
224 :CLOUD_IGNORE_SSL: Ignore unverified SSL certificates. (default: false)
225 :CLOUD_ZONE: OpenStack region to use. (default: "")
226 :CLOUD_CREDENTIAL_ID: Credential to use for authentication to OpenStack.
227 (default: "os-cloud")
228 :INSTANCE_CAP: Total number of instances the cloud will allow spin up.
230 :SANDBOX_CAP: Total number of instances the cloud will allow to
231 spin up. This applies to "sandbox" systems and overrides the
232 INSTANCE_CAP setting. (default: null)
234 :Template Parameters:
238 In the case of template definitions of a parameter below is not passed
239 the one defined in default clouds will be inherited.
241 :IMAGE_NAME: The image name to use for this template.
243 :HARDWARE_ID: OpenStack flavor to use. (required)
245 :LABELS: Labels to assign to the vm. (default: FILE_NAME)
246 :NETWORK_ID: OpenStack network to use. (default: "")
247 :USER_DATA_ID: User Data to pass into the instance.
248 (default: jenkins-init-script)
249 :INSTANCE_CAP: Total number of instances of this type that can be launched
250 at one time. When defined in clouds.cfg it defines the total for the
251 entire cloud. (default: null)
252 :SANDBOX_CAP: Total number of instances of this type that can be launched
253 at one time. When defined in clouds.cfg it defines the total for the
254 entire cloud. This applies to "sandbox" systems and overrides the
255 INSTANCE_CAP setting. (default: null)
256 :FLOATING_IP_POOL: Floating ip pool to use. (default: "")
257 :SECURITY_GROUPS: Security group to use. (default: "default")
258 :AVAILABILITY_ZONE: OpenStack availability zone to use. (default: "")
259 :START_TIMEOUT: Number of milliseconds to wait for the agent to be
260 provisioned and connected. (default: 600000)
261 :KEY_PAIR_NAME: SSH Public Key Pair to use for authentication.
263 :NUM_EXECUTORS: Number of executors to enable for the instance.
265 :JVM_OPTIONS: JVM Options to pass to Java. (default: "")
266 :FS_ROOT: File system root for the workspace. (default: "/w")
267 :RETENTION_TIME: Number of minutes to wait for an idle slave to be used
268 again before it's removed. If set to -1, the slave will be kept
269 forever. (default: 0)
270 :CONNECTION_TYPE: The connection type for Jenkins to connect to the build
271 minion. Valid options: JNLP, SSH. (default: "SSH")
273 For a live example see the OpenDaylight project jenkins-config directory.
274 https://github.com/opendaylight/releng-builder/tree/master/jenkins-config
279 :Cloud Configuration:
281 The directory ``groovy-inserts`` contains the groovy script output that is
282 used to push to Jenkins. In the event of a job failure this file can be
285 .. _lf-global-jjb-jenkins-cfg-verify:
287 Jenkins Configuration Verify
288 ----------------------------
290 Jenkins job to verify the Global Jenkins configuration.
292 Requires the ``clouds-yaml`` file to be setup on the Jenkins host.
296 - {project-name}-jenkins-cfg-verify
297 - gerrit-jenkins-cfg-verify
298 - github-jenkins-cfg-verify
300 :Optional parameters:
302 :branch: Git branch to build against. (default: master)
303 :git-url: URL to clone project from. (default: $GIT_URL/$GERRIT_PROJECT)
305 This job is not part of the "{project-name}-ci-jobs" group. It must be called
310 .. literalinclude:: ../../.jjb-test/lf-ci-jobs/jenkins-cfg-verify.yaml
313 Jenkins Sandbox Cleanup
314 -----------------------
316 Cleanup Jenkins Sandbox of jobs and views periodically.
320 - {project-name}-jenkins-sandbox-cleanup
321 - gerrit-jenkins-sandbox-cleanup
322 - github-jenkins-sandbox-cleanup
324 :Comment Trigger: NONE
326 :Required parameters:
328 :build-node: The node to run build on.
329 :jenkins-ssh-credential: Credential to use for SSH. (Generally
330 should be configured in defaults.yaml)
332 :Optional parameters:
334 :cron: Schedule to run job. (default: '0 8 * * 6')
340 Deploy jobs to jenkins-sandbox system via code review comment
342 This job checks out the current code review patch and then runs a
343 `jenkins-jobs update` to push a patch defined by the comment.
347 - {project-name}-jjb-deploy-job
348 - gerrit-jjb-deploy-job
349 - github-jjb-deploy-job
351 :Comment Trigger: jjb-deploy JOB_NAME
355 JOB_NAME can include the * wildcard character to push multiple jobs
356 matching the pattern. For example `jjb-deploy builder-jjb-*`` will push
357 all builder-jjb-* jobs to the sandbox system.
359 :Required parameters:
361 :build-node: The node to run build on.
362 :jenkins-ssh-credential: Credential to use for SSH. (Generally
363 should be configured in defaults.yaml)
365 :Optional parameters:
367 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
368 :gerrit_jjb_deploy_job_triggers: Override Gerrit Triggers.
374 Runs `jenkins-jobs update` to update production job configuration
377 - {project-name}-jjb-merge
381 :Comment Trigger: remerge
383 :Required parameters:
385 :build-node: The node to run build on.
386 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
387 be configured in defaults.yaml)
389 :Optional parameters:
391 :branch: Git branch to fetch for the build. (default: master)
392 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
393 :build-timeout: Timeout in minutes before aborting build. (default: 10)
394 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
395 :jjb-version: JJB version to install. (default: see job-template)
396 :stream: Keyword that can be used to represent a release code-name.
397 Often the same as the branch. (default: master)
398 :submodule-recursive: Whether to checkout submodules recursively.
400 :submodule-timeout: Timeout (in minutes) for checkout operation.
403 :gerrit_merge_triggers: Override Gerrit Triggers.
404 :gerrit_trigger_file_paths: Override file paths which can be used to
405 filter which file modifications will trigger a build.
406 (default defined by lf_jjb_common)
412 Runs `jenkins-jobs test` to validate JJB syntax
415 - {project-name}-jjb-verify
419 :Comment Trigger: recheck|reverify
421 :Required parameters:
423 :build-node: The node to run build on.
424 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
425 be configured in defaults.yaml)
427 :Optional parameters:
429 :branch: Git branch to fetch for the build. (default: master)
430 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
431 :build-timeout: Timeout in minutes before aborting build. (default: 10)
432 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
433 :jjb-version: JJB version to install. (default: see job-template)
434 :stream: Keyword that can be used to represent a release code-name.
435 Often the same as the branch. (default: master)
436 :submodule-recursive: Whether to checkout submodules recursively.
438 :submodule-timeout: Timeout (in minutes) for checkout operation.
441 :gerrit_verify_triggers: Override Gerrit Triggers.
442 :gerrit_trigger_file_paths: Override file paths which can be used to
443 filter which file modifications will trigger a build.
444 (default defined by lf_jjb_common)
446 .. _jjb-verify-upstream-gjjb:
448 JJB Verify Upstream Global JJB
449 ------------------------------
451 Runs ``jenkins-jobs test`` to validate JJB syntax for upstream global-jjb
452 patches. This job is useful to notify upstream that they may be breaking
456 - {project-name}-jjb-verify-upstream-gjjb
457 - gerrit-jjb-verify-upstream-gjjb
459 :Comment Trigger: recheck|reverify
461 :Required parameters:
463 :build-node: The node to run build on.
464 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
465 be configured in defaults.yaml)
467 :Optional parameters:
469 :branch: Git branch to fetch for the build. (default: master)
470 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
471 :build-timeout: Timeout in minutes before aborting build. (default: 10)
472 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
473 :jjb-version: JJB version to install. (default: see job-template)
474 :stream: Keyword that can be used to represent a release code-name.
475 Often the same as the branch. (default: master)
477 .. _info-yaml-verify:
482 Info YAML Verify job validates that INFO.yaml file changes are kept isolated from
483 other file changes. Verifies INFO.yaml files follow the schema defined in
484 `global-jjb/info-schema`.
487 - {project-name}-info-yaml-verify
488 - gerrit-info-yaml-verify
489 - github-info-yaml-verify
491 :Required parameters:
493 :build-node: The node to run build on.
494 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
495 be configured in defaults.yaml)
497 :Optional parameters:
499 :branch: Git branch to fetch for the build. (default: master)
500 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
501 :build-timeout: Timeout in minutes before aborting build. (default: 10)
502 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
503 :stream: Keyword that can be used to represent a release code-name.
504 Often the same as the branch. (default: master)
505 :submodule-recursive: Whether to checkout submodules recursively.
507 :submodule-timeout: Timeout (in minutes) for checkout operation.
510 :gerrit_verify_triggers: Override Gerrit Triggers.
517 Job to scan projects for files missing license headers.
520 - {project-name}-license-check
521 - gerrit-license-check
522 - github-license-check
524 :Optional parameters:
526 :build-timeout: Timeout in minutes before aborting build. (default: 15)
527 :file-patterns: Space-separated list of file patterns to scan.
528 (default: \*.go \*.groovy \*.java \*.py \*.sh)
529 :spdx-disable: Disable the SPDX-Identifier checker. (default: false)
530 :lhc-version: Version of LHC to use. (default: 0.2.0)
531 :license-exclude-paths: Comma-separated list of paths to exclude from the
532 license checker. The paths used here will be matched using a contains
533 rule so it is best to be as precise with the path as possible.
534 For example a path of '/src/generated/' will be searched as
535 '**/src/generated/**'.
536 Example: org/opendaylight/yang/gen,protobuff/messages
538 :licenses-allowed: Comma-separated list of allowed licenses.
539 (default: Apache-2.0,EPL-1.0,MIT)
540 :project-pattern: The ANT based pattern for Gerrit Trigger to choose which
541 projects to trigger job against. (default: '**')
543 .. _gjjb-openstack-cron:
548 Cron job that runs regularly to perform periodic tasks against OpenStack.
550 This job requires a Config File Provider file named ``clouds-yaml`` available
551 containing the credentials for the cloud.
554 - {project-name}-openstack-cron
555 - gerrit-openstack-cron
556 - github-openstack-cron
558 :Required parameters:
560 :build-node: The node to run build on.
561 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
562 be configured in defaults.yaml)
564 :Optional parameters:
566 :branch: Git branch to fetch for the build. (default: master)
567 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
568 :build-timeout: Timeout in minutes before aborting build. (default: 90)
569 :cron: Time when the packer image should be rebuilt (default: @daily)
570 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
571 :openstack-cloud: OS_CLOUD setting to pass to openstack client.
573 :stream: Keyword that can be used to represent a release code-name.
574 Often the same as the branch. (default: master)
575 :submodule-recursive: Whether to checkout submodules recursively.
577 :submodule-timeout: Timeout (in minutes) for checkout operation.
580 .. _gjjb-packer-merge:
585 Packer Merge job runs `packer build` to build system images in the cloud.
588 - {project-name}-packer-merge-{platforms}-{templates}
589 - gerrit-packer-merge
590 - github-packer-merge
592 :Comment Trigger: remerge
594 :Required parameters:
596 :build-node: The node to run build on.
597 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
598 be configured in defaults.yaml)
599 :mvn-settings: The name of settings file containing credentials for
601 :platforms: Platform or distribution to build. Typically json file
602 found in the packer/vars directory. (Example: centos)
603 :template: System template to build. Typically shell script found in
604 the packer/provision directory. (Example: java-builder)
606 :Optional parameters:
608 :cron: Time when the packer image should be rebuilt (default: @monthly)
609 :branch: Git branch to fetch for the build. (default: master)
610 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
611 :build-timeout: Timeout in minutes before aborting build. (default: 90)
612 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
613 :openstack: Packer template uses an OpenStack builder (default: true).
614 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
616 :packer-cloud-settings: Name of settings file containing credentials
617 for the cloud that packer will build on. (default: packer-cloud-env)
618 :packer-version: Version of packer to install / use in build. (default: 1.0.2)
619 :stream: Keyword that can be used to represent a release code-name.
620 Often the same as the branch. (default: master)
621 :submodule-recursive: Whether to checkout submodules recursively.
623 :submodule-timeout: Timeout (in minutes) for checkout operation.
626 :gerrit_verify_triggers: Override Gerrit Triggers.
629 .. _gjjb-packer-verify:
634 Packer Verify job runs `packer validate` to verify packer configuration.
637 - {project-name}-packer-verify
638 - gerrit-packer-verify
639 - github-packer-verify
641 :Comment Trigger: recheck|reverify
643 :Required parameters:
645 :build-node: The node to run build on.
646 :jenkins-ssh-credential: Credential to use for SSH. (Generally should
647 be configured in defaults.yaml)
648 :mvn-settings: The name of settings file containing credentials for
651 :Optional parameters:
653 :branch: Git branch to fetch for the build. (default: master)
654 :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
655 :build-timeout: Timeout in minutes before aborting build. (default: 10)
656 :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
657 :openstack: Packer template uses an OpenStack builder (default: true).
658 :openstack-cloud: Sets OS_CLOUD variable to the value of this parameter.
660 :packer-cloud-settings: Name of settings file containing credentials
661 for the cloud that packer will build on. (default: packer-cloud-env)
662 :packer-version: Version of packer to install / use in build. (default: 1.0.2)
663 :stream: Keyword that can be used to represent a release code-name.
664 Often the same as the branch. (default: master)
665 :submodule-recursive: Whether to checkout submodules recursively.
667 :submodule-timeout: Timeout (in minutes) for checkout operation.
670 :gerrit_verify_triggers: Override Gerrit Triggers.
671 :gerrit_trigger_file_paths: Override file paths which can be used to
672 filter which file modifications will trigger a build.