3 name: '{project-name}-ci-jobs'
5 # This job group contains all the recommended jobs that should be deployed
15 name: '{project-name}-github-ci-jobs'
17 # This job group contains all the recommended jobs that should be deployed
18 # for any project ci that is using github.
28 name: '{project-name}-packer-jobs'
30 # This job group contains all the recommended jobs that should be deployed
31 # for any project ci that is using packer.
37 - gerrit-packer-verify
41 name: '{project-name}-github-packer-jobs'
43 # This job group contains all the recommended jobs that should be deployed
44 # for any project ci that is using packer.
50 - github-packer-verify
59 - config-file-provider:
62 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
64 - lf_packer_file_paths: &lf_packer_file_paths
65 name: lf-packer-file-paths
67 # Common files for all projects
69 pattern: 'packer/vars/{platforms}.json'
71 pattern: 'packer/templates/{templates}.json'
73 pattern: 'packer/provision/{templates}.sh'
75 pattern: 'packer/provision/lib/**'
77 - lf_packer: &lf_packer_common
78 name: lf-packer-common
79 # Provide configuration common in packer jobs.
81 ######################
82 # Default parameters #
83 ######################
88 submodule-recursive: true
89 packer-cloud-settings: packer-cloud-env
95 project-type: freestyle
99 - lf-infra-properties:
101 build-days-to-keep: 7
104 - lf-infra-parameters:
108 lftools-version: '{lftools-version}'
109 - lf-infra-packer-parameters:
110 packer-version: '{packer-version}'
114 build-timeout: '{build-timeout}'
115 jenkins-ssh-credential: '{jenkins-ssh-credential}'
121 name: lf-infra-jjb-parameters
125 default: '{jjb-version}'
126 description: Jenkins Job Builder version to download and install.
129 name: lf-infra-packer-parameters
133 default: '{packer-version}'
134 description: Packer version to download and install.
136 - lf_jjb_common: &lf_jjb_common
139 ######################
140 # Default parameters #
141 ######################
146 submodule-recursive: true
148 gerrit_trigger_file_paths:
154 pattern: '**/global-jjb'
156 #####################
157 # Job Configuration #
158 #####################
160 project-type: freestyle
164 - lf-infra-properties:
166 build-days-to-keep: 7
169 - lf-infra-parameters:
173 lftools-version: '{lftools-version}'
174 - lf-infra-jjb-parameters:
175 jjb-version: '{jjb-version}'
179 build-timeout: '{build-timeout}'
180 jenkins-ssh-credential: '{jenkins-ssh-credential}'
185 ######################
186 # Gerrit Branch Lock #
187 ######################
190 name: '{project-name}-gerrit-branch-lock-{stream}'
191 id: gerrit-branch-lock
193 ######################
194 # Default parameters #
195 ######################
198 git-url: '$GIT_URL/$GERRIT_PROJECT'
200 gerrit_merge_triggers:
201 - comment-added-contains-event:
202 comment-contains-value: (un)?lock branch$
204 #####################
205 # Job Configuration #
206 #####################
208 project-type: freestyle
212 - lf-infra-properties:
214 build-days-to-keep: 1
217 - lf-infra-parameters:
221 lftools-version: '{lftools-version}'
226 jenkins-ssh-credential: '{jenkins-ssh-credential}'
229 - lf-infra-gerrit-scm:
233 submodule-recursive: false
234 choosing-strategy: default
235 jenkins-ssh-credential: '{jenkins-ssh-credential}'
239 server-name: '{gerrit-server-name}'
240 trigger-on: '{obj:gerrit_merge_triggers}'
242 - project-compare-type: ANT
243 project-pattern: '{project}'
245 - branch-compare-type: ANT
246 branch-pattern: '**/{branch}'
249 - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
259 - lf_jjb_merge: &lf_jjb_merge
262 # JJB Merge job runs `jenkins-jobs update` to update production job configuration
264 # Required parameters:
266 # :build-node: The node to run build on.
267 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
268 # be configured in defaults.yaml)
269 # :mvn-settings: The name of settings file containing credentials for
272 # Optional parameters:
274 # :branch: Git branch to fetch for the build. (default: master)
275 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
276 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
277 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
278 # :stream: Keyword that can be used to represent a release code-name.
279 # Often the same as the branch. (default: master)
280 # :submodule-recursive: Whether to checkout submodules recursively.
283 # :gerrit_merge_triggers: Override Gerrit Triggers.
284 # :gerrit_trigger_file_paths: Override file paths which can be used to
285 # filter which file modifications will trigger a build.
286 # (default defined by lf_jjb_common)
288 ######################
289 # Default parameters #
290 ######################
292 gerrit_merge_triggers:
293 - change-merged-event
294 - comment-added-contains-event:
295 comment-contains-value: remerge$
297 #####################
298 # Job Configuration #
299 #####################
303 - shell: !include-raw-escape:
304 - ../shell/jjb-install.sh
305 - ../shell/jjb-merge-job.sh
308 name: '{project-name}-jjb-merge'
311 # yamllint disable-line rule:key-duplicates
314 git-url: '$GIT_URL/$GERRIT_PROJECT'
317 - lf-infra-gerrit-scm:
321 submodule-recursive: '{submodule-recursive}'
322 choosing-strategy: default
323 jenkins-ssh-credential: '{jenkins-ssh-credential}'
327 server-name: '{gerrit-server-name}'
328 trigger-on: '{obj:gerrit_merge_triggers}'
330 - project-compare-type: ANT
331 project-pattern: '{project}'
333 - branch-compare-type: ANT
334 branch-pattern: '**/{branch}'
335 file-paths: '{obj:gerrit_trigger_file_paths}'
338 name: '{project-name}-jjb-merge'
341 # yamllint disable-line rule:key-duplicates
346 url: '{git-url}/{github-org}/{project}'
349 - lf-infra-github-scm:
350 url: '{git-clone-url}{github-org}/{project}'
353 submodule-recursive: '{submodule-recursive}'
354 choosing-strategy: default
355 jenkins-ssh-credential: '{jenkins-ssh-credential}'
361 - lf-infra-github-pr-trigger:
362 trigger-phrase: '^remerge$'
363 only-trigger-phrase: true
364 status-context: 'JJB Merge'
367 github-org: '{github-org}'
368 github_pr_whitelist: '{obj:github_pr_whitelist}'
369 github_pr_admin_list: '{obj:github_pr_admin_list}'
375 - lf_jjb_verify: &lf_jjb_verify
378 # JJB Verify job runs `jenkins-jobs test` to validate JJB syntax
380 # Required parameters:
382 # :build-node: The node to run build on.
383 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
384 # be configured in defaults.yaml)
385 # :mvn-settings: The name of settings file containing credentials for
388 # Optional parameters:
390 # :branch: Git branch to fetch for the build. (default: master)
391 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
392 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
393 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
394 # :stream: Keyword that can be used to represent a release code-name.
395 # Often the same as the branch. (default: master)
396 # :submodule-recursive: Whether to checkout submodules recursively.
399 # :gerrit_verify_triggers: Override Gerrit Triggers.
400 # :gerrit_trigger_file_paths: Override file paths which can be used to
401 # filter which file modifications will trigger a build.
402 # (default defined by lf_jjb_common)
404 ######################
405 # Default parameters #
406 ######################
408 gerrit_verify_triggers:
409 - patchset-created-event:
410 exclude-drafts: false
411 exclude-trivial-rebase: false
412 exclude-no-code-change: false
413 - draft-published-event
414 - comment-added-contains-event:
415 comment-contains-value: recheck$
417 #####################
418 # Job Configuration #
419 #####################
425 - shell: !include-raw-escape:
426 - ../shell/git-validate-jira-urls.sh
427 - ../shell/jjb-install.sh
428 - ../shell/jjb-verify-job.sh
429 - ../shell/jjb-check-unicode.sh
430 - lf-infra-gpg-verify-git-signature
433 name: '{project-name}-jjb-verify'
434 id: gerrit-jjb-verify
436 # yamllint disable-line rule:key-duplicates
439 git-url: '$GIT_URL/$GERRIT_PROJECT'
442 - lf-infra-gerrit-scm:
444 refspec: '$GERRIT_REFSPEC'
445 branch: '$GERRIT_BRANCH'
446 submodule-recursive: '{submodule-recursive}'
447 choosing-strategy: gerrit
448 jenkins-ssh-credential: '{jenkins-ssh-credential}'
452 server-name: '{gerrit-server-name}'
453 trigger-on: '{obj:gerrit_verify_triggers}'
455 - project-compare-type: ANT
456 project-pattern: '{project}'
458 - branch-compare-type: ANT
459 branch-pattern: '**/{branch}'
460 file-paths: '{obj:gerrit_trigger_file_paths}'
463 name: '{project-name}-jjb-verify'
464 id: github-jjb-verify
466 # yamllint disable-line rule:key-duplicates
471 url: '{git-url}/{github-org}/{project}'
474 - lf-infra-github-scm:
475 url: '{git-clone-url}{github-org}/{project}'
476 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
478 submodule-recursive: '{submodule-recursive}'
479 choosing-strategy: default
480 jenkins-ssh-credential: '{jenkins-ssh-credential}'
483 - lf-infra-github-pr-trigger:
484 trigger-phrase: '^recheck$'
485 only-trigger-phrase: false
486 status-context: 'JJB Verify'
492 github_pr_admin_list:
499 - lf_packer_merge: &lf_packer_merge
500 name: lf-packer-merge
502 # Packer Merge job runs `packer build` to build system images in the cloud.
504 # Required parameters:
506 # :build-node: The node to run build on.
507 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
508 # be configured in defaults.yaml)
509 # :mvn-settings: The name of settings file containing credentials for
511 # :platforms: Platform or distribution to build. Typically json file
512 # found in the packer/vars directory. (Example: centos)
513 # :template: System template to build. Typically shell script found in
514 # the packer/provision directory. (Example: java-builder)
516 # Optional parameters:
518 # :branch: Git branch to fetch for the build. (default: master)
519 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
520 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
521 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
522 # :packer-cloud-settings: Name of settings file containing credentials
523 # for the cloud that packer will build on. (default: packer-cloud-env)
524 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
525 # :stream: Keyword that can be used to represent a release code-name.
526 # Often the same as the branch. (default: master)
527 # :submodule-recursive: Whether to checkout submodules recursively.
530 # :gerrit_verify_triggers: Override Gerrit Triggers.
531 # :gerrit_trigger_file_paths: Override file paths which can be used to
532 # filter which file modifications will trigger a build.
533 # (default defined by lf_jjb_common)
535 ######################
536 # Default parameters #
537 ######################
539 gerrit_merge_triggers:
540 - change-merged-event
541 - comment-added-contains-event:
542 comment-contains-value: remerge$
544 #####################
545 # Job Configuration #
546 #####################
549 - lf-infra-packer-validate:
550 packer-cloud-settings: '{packer-cloud-settings}'
551 packer-version: '{packer-version}'
552 - lf-infra-packer-build:
553 packer-cloud-settings: '{packer-cloud-settings}'
554 packer-version: '{packer-version}'
555 platform: '{platforms}'
556 template: '{templates}'
559 name: '{project-name}-packer-merge-{platforms}-{templates}'
560 id: gerrit-packer-merge
561 <<: *lf_packer_common
562 # yamllint disable-line rule:key-duplicates
565 git-url: '$GIT_URL/$GERRIT_PROJECT'
568 - lf-infra-gerrit-scm:
570 refspec: '$GERRIT_REFSPEC'
571 branch: '$GERRIT_BRANCH'
572 submodule-recursive: '{submodule-recursive}'
573 choosing-strategy: gerrit
574 jenkins-ssh-credential: '{jenkins-ssh-credential}'
577 - timed: '00 10 1 * *'
579 server-name: '{gerrit-server-name}'
580 trigger-on: '{obj:gerrit_merge_triggers}'
582 - project-compare-type: ANT
583 project-pattern: '{project}'
585 - branch-compare-type: ANT
586 branch-pattern: '**/{branch}'
587 <<: *lf_packer_file_paths
590 name: '{project-name}-packer-merge-{platforms}-{templates}'
591 id: github-packer-merge
592 <<: *lf_packer_common
593 # yamllint disable-line rule:key-duplicates
598 url: '{git-url}/{github-org}/{project}'
601 - lf-infra-github-scm:
602 url: '{git-clone-url}{github-org}/{project}'
605 submodule-recursive: '{submodule-recursive}'
606 choosing-strategy: default
607 jenkins-ssh-credential: '{jenkins-ssh-credential}'
610 - timed: '00 10 1 * *'
614 - lf-infra-github-pr-trigger:
615 trigger-phrase: '^remerge$'
616 only-trigger-phrase: true
617 status-context: 'Packer {platforms}-${templates} Merge'
620 github-org: '{github-org}'
621 github_pr_whitelist: '{obj:github_pr_whitelist}'
622 github_pr_admin_list: '{obj:github_pr_admin_list}'
628 - lf_packer_verify: &lf_packer_verify
629 name: lf-packer-verify
631 # Packer Verify job runs `packer validate` to verify packer configuration.
633 # Required parameters:
635 # :build-node: The node to run build on.
636 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
637 # be configured in defaults.yaml)
638 # :mvn-settings: The name of settings file containing credentials for
641 # Optional parameters:
643 # :branch: Git branch to fetch for the build. (default: master)
644 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
645 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
646 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
647 # :packer-cloud-settings: Name of settings file containing credentials
648 # for the cloud that packer will build on. (default: packer-cloud-env)
649 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
650 # :stream: Keyword that can be used to represent a release code-name.
651 # Often the same as the branch. (default: master)
652 # :submodule-recursive: Whether to checkout submodules recursively.
655 # :gerrit_verify_triggers: Override Gerrit Triggers.
656 # :gerrit_trigger_file_paths: Override file paths which can be used to
657 # filter which file modifications will trigger a build.
658 # (default defined by lf_jjb_common)
660 ######################
661 # Default parameters #
662 ######################
666 gerrit_verify_triggers:
667 - patchset-created-event:
668 exclude-drafts: false
669 exclude-trivial-rebase: false
670 exclude-no-code-change: false
671 - draft-published-event
672 - comment-added-contains-event:
673 comment-contains-value: recheck$
675 #####################
676 # Job Configuration #
677 #####################
682 - lf-infra-packer-validate:
683 packer-cloud-settings: '{packer-cloud-settings}'
684 packer-version: '{packer-version}'
687 name: '{project-name}-packer-verify'
688 id: gerrit-packer-verify
689 <<: *lf_packer_common
690 # yamllint disable-line rule:key-duplicates
691 <<: *lf_packer_verify
693 git-url: '$GIT_URL/$GERRIT_PROJECT'
696 - lf-infra-gerrit-scm:
698 refspec: '$GERRIT_REFSPEC'
699 branch: '$GERRIT_BRANCH'
700 submodule-recursive: '{submodule-recursive}'
701 choosing-strategy: gerrit
702 jenkins-ssh-credential: '{jenkins-ssh-credential}'
706 server-name: '{gerrit-server-name}'
707 trigger-on: '{obj:gerrit_verify_triggers}'
709 - project-compare-type: ANT
710 project-pattern: '{project}'
712 - branch-compare-type: ANT
713 branch-pattern: '**/{branch}'
714 <<: *lf_packer_file_paths
717 name: '{project-name}-packer-verify'
718 id: github-packer-verify
719 <<: *lf_packer_common
720 # yamllint disable-line rule:key-duplicates
721 <<: *lf_packer_verify
725 url: '{git-url}/{github-org}/{project}'
728 - lf-infra-github-scm:
729 url: '{git-clone-url}{github-org}/{project}'
730 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
732 submodule-recursive: '{submodule-recursive}'
733 choosing-strategy: default
734 jenkins-ssh-credential: '{jenkins-ssh-credential}'
737 - lf-infra-github-pr-trigger:
738 trigger-phrase: '^recheck$'
739 only-trigger-phrase: false
740 status-context: 'Packer Verify'
746 github_pr_admin_list: