3 name: '{project-name}-ci-jobs'
5 # This job group contains all the recommended jobs that should be deployed
11 - gerrit-jjb-deploy-job
16 name: '{project-name}-github-ci-jobs'
18 # This job group contains all the recommended jobs that should be deployed
19 # for any project ci that is using github.
24 - github-jjb-deploy-job
30 name: '{project-name}-packer-jobs'
32 # This job group contains all the recommended jobs that should be deployed
33 # for any project ci that is using packer.
39 - gerrit-packer-verify
43 name: '{project-name}-github-packer-jobs'
45 # This job group contains all the recommended jobs that should be deployed
46 # for any project ci that is using packer.
52 - github-packer-verify
61 - config-file-provider:
64 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
67 name: lf-infra-jjbini-sandbox
68 # TODO: Consolidate this into jjbini when JJB2.0 is available.
70 - config-file-provider:
72 - file-id: jjbini-sandbox
73 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
75 - lf_packer_file_paths: &lf_packer_file_paths
76 name: lf-packer-file-paths
78 # Common files for all projects
80 pattern: 'packer/vars/{platforms}.json'
82 pattern: 'packer/templates/{templates}.json'
84 pattern: 'packer/provision/{templates}.sh'
86 pattern: 'packer/provision/lib/**'
88 - lf_packer: &lf_packer_common
89 name: lf-packer-common
90 # Provide configuration common in packer jobs.
92 ######################
93 # Default parameters #
94 ######################
99 submodule-recursive: true
100 packer-cloud-settings: packer-cloud-env
102 #####################
103 # Job Configuration #
104 #####################
106 project-type: freestyle
110 - lf-infra-properties:
112 build-days-to-keep: 7
115 - lf-infra-parameters:
119 lftools-version: '{lftools-version}'
120 - lf-infra-packer-parameters:
121 packer-version: '{packer-version}'
125 build-timeout: '{build-timeout}'
126 jenkins-ssh-credential: '{jenkins-ssh-credential}'
132 name: lf-infra-jjb-parameters
136 default: '{jjb-version}'
137 description: Jenkins Job Builder version to download and install.
140 name: lf-infra-packer-parameters
144 default: '{packer-version}'
145 description: Packer version to download and install.
147 - lf_jjb_common: &lf_jjb_common
150 ######################
151 # Default parameters #
152 ######################
157 submodule-recursive: true
159 gerrit_trigger_file_paths:
165 pattern: '**/global-jjb'
167 #####################
168 # Job Configuration #
169 #####################
171 project-type: freestyle
175 - lf-infra-properties:
177 build-days-to-keep: 7
180 - lf-infra-parameters:
184 lftools-version: '{lftools-version}'
185 - lf-infra-jjb-parameters:
186 jjb-version: '{jjb-version}'
190 build-timeout: '{build-timeout}'
191 jenkins-ssh-credential: '{jenkins-ssh-credential}'
196 ######################
197 # Gerrit Branch Lock #
198 ######################
201 name: '{project-name}-gerrit-branch-lock-{stream}'
202 id: gerrit-branch-lock
204 ######################
205 # Default parameters #
206 ######################
209 git-url: '$GIT_URL/$GERRIT_PROJECT'
211 gerrit_merge_triggers:
212 - comment-added-contains-event:
213 comment-contains-value: (un)?lock branch$
215 #####################
216 # Job Configuration #
217 #####################
219 project-type: freestyle
223 - lf-infra-properties:
225 build-days-to-keep: 1
228 - lf-infra-parameters:
232 lftools-version: '{lftools-version}'
237 jenkins-ssh-credential: '{jenkins-ssh-credential}'
240 - lf-infra-gerrit-scm:
244 submodule-recursive: false
245 choosing-strategy: default
246 jenkins-ssh-credential: '{jenkins-ssh-credential}'
250 server-name: '{gerrit-server-name}'
251 trigger-on: '{obj:gerrit_merge_triggers}'
253 - project-compare-type: ANT
254 project-pattern: '{project}'
256 - branch-compare-type: ANT
257 branch-pattern: '**/{branch}'
260 - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
270 - lf_jjb_deploy_job: &lf_jjb_deploy_job
271 name: lf-jjb-deploy-job
273 # Deploy jobs to jenkins-sandbox system via code review comment
275 # This job checks out the current code review patch and then runs a
276 # `jenkins-jobs update` to push a patch defined by the comment.
278 # Comment Trigger: jjb-deploy JOB_NAME
280 # JOB_NAME can include the * wildcard character to push multiple jobs
281 # matching the pattern. For example `jjb-deploy builder-jjb-*`` will push
282 # all builder-jjb-* jobs to the sandbox system.
284 # Required parameters:
286 # :build-node: The node to run build on.
287 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
288 # be configured in defaults.yaml)
290 # Optional parameters:
292 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
293 # :gerrit_jjb_deploy_job_triggers: Override Gerrit Triggers.
295 ######################
296 # Default parameters #
297 ######################
300 git-url: '$GIT_URL/$GERRIT_PROJECT'
302 gerrit_jjb_deploy_job_triggers:
303 - comment-added-contains-event:
304 comment-contains-value: jjb-deploy (?!\*+$).+$
306 #####################
307 # Job Configuration #
308 #####################
310 project-type: freestyle
315 - lf-infra-properties:
317 build-days-to-keep: 1
320 - lf-infra-parameters:
324 lftools-version: '{lftools-version}'
329 jenkins-ssh-credential: '{jenkins-ssh-credential}'
333 pip-packages: jenkins-job-builder
334 - lf-infra-jjbini-sandbox
335 - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
341 name: '{project-name}-jjb-deploy-job'
342 id: gerrit-jjb-deploy-job
343 <<: *lf_jjb_deploy_job
346 - lf-infra-gerrit-scm:
348 refspec: 'refs/heads/{branch}'
350 submodule-recursive: true
351 choosing-strategy: default
352 jenkins-ssh-credential: '{jenkins-ssh-credential}'
356 server-name: '{gerrit-server-name}'
357 trigger-on: '{obj:gerrit_jjb_deploy_job_triggers}'
359 - project-compare-type: ANT
360 project-pattern: '{project}'
362 - branch-compare-type: ANT
363 branch-pattern: '**/{branch}'
366 name: '{project-name}-jjb-deploy-job'
367 id: github-jjb-deploy-job
368 <<: *lf_jjb_deploy_job
372 url: '{git-url}/{github-org}/{project}'
375 - lf-infra-github-scm:
376 url: '{git-clone-url}{github-org}/{project}'
377 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
379 submodule-recursive: true
380 choosing-strategy: default
381 jenkins-ssh-credential: '{jenkins-ssh-credential}'
384 - lf-infra-github-pr-trigger:
385 trigger-phrase: '^jjb-deploy (?!\*+$).+$'
386 only-trigger-phrase: true
387 status-context: 'JJB Deploy Job'
393 github_pr_admin_list:
400 - lf_jjb_merge: &lf_jjb_merge
403 # JJB Merge job runs `jenkins-jobs update` to update production job configuration
405 # Required parameters:
407 # :build-node: The node to run build on.
408 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
409 # be configured in defaults.yaml)
410 # :mvn-settings: The name of settings file containing credentials for
413 # Optional parameters:
415 # :branch: Git branch to fetch for the build. (default: master)
416 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
417 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
418 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
419 # :stream: Keyword that can be used to represent a release code-name.
420 # Often the same as the branch. (default: master)
421 # :submodule-recursive: Whether to checkout submodules recursively.
424 # :gerrit_merge_triggers: Override Gerrit Triggers.
425 # :gerrit_trigger_file_paths: Override file paths which can be used to
426 # filter which file modifications will trigger a build.
427 # (default defined by lf_jjb_common)
429 ######################
430 # Default parameters #
431 ######################
433 gerrit_merge_triggers:
434 - change-merged-event
435 - comment-added-contains-event:
436 comment-contains-value: remerge$
438 #####################
439 # Job Configuration #
440 #####################
444 - shell: !include-raw-escape:
445 - ../shell/jjb-install.sh
446 - ../shell/jjb-merge-job.sh
449 name: '{project-name}-jjb-merge'
452 # yamllint disable-line rule:key-duplicates
455 git-url: '$GIT_URL/$GERRIT_PROJECT'
458 - lf-infra-gerrit-scm:
462 submodule-recursive: '{submodule-recursive}'
463 choosing-strategy: default
464 jenkins-ssh-credential: '{jenkins-ssh-credential}'
468 server-name: '{gerrit-server-name}'
469 trigger-on: '{obj:gerrit_merge_triggers}'
471 - project-compare-type: ANT
472 project-pattern: '{project}'
474 - branch-compare-type: ANT
475 branch-pattern: '**/{branch}'
476 file-paths: '{obj:gerrit_trigger_file_paths}'
479 name: '{project-name}-jjb-merge'
482 # yamllint disable-line rule:key-duplicates
487 url: '{git-url}/{github-org}/{project}'
490 - lf-infra-github-scm:
491 url: '{git-clone-url}{github-org}/{project}'
494 submodule-recursive: '{submodule-recursive}'
495 choosing-strategy: default
496 jenkins-ssh-credential: '{jenkins-ssh-credential}'
502 - lf-infra-github-pr-trigger:
503 trigger-phrase: '^remerge$'
504 only-trigger-phrase: true
505 status-context: 'JJB Merge'
508 github-org: '{github-org}'
509 github_pr_whitelist: '{obj:github_pr_whitelist}'
510 github_pr_admin_list: '{obj:github_pr_admin_list}'
516 - lf_jjb_verify: &lf_jjb_verify
519 # JJB Verify job runs `jenkins-jobs test` to validate JJB syntax
521 # Required parameters:
523 # :build-node: The node to run build on.
524 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
525 # be configured in defaults.yaml)
526 # :mvn-settings: The name of settings file containing credentials for
529 # Optional parameters:
531 # :branch: Git branch to fetch for the build. (default: master)
532 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
533 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
534 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
535 # :stream: Keyword that can be used to represent a release code-name.
536 # Often the same as the branch. (default: master)
537 # :submodule-recursive: Whether to checkout submodules recursively.
540 # :gerrit_verify_triggers: Override Gerrit Triggers.
541 # :gerrit_trigger_file_paths: Override file paths which can be used to
542 # filter which file modifications will trigger a build.
543 # (default defined by lf_jjb_common)
545 ######################
546 # Default parameters #
547 ######################
549 gerrit_verify_triggers:
550 - patchset-created-event:
552 exclude-trivial-rebase: false
553 exclude-no-code-change: false
554 - draft-published-event
555 - comment-added-contains-event:
556 comment-contains-value: recheck$
558 #####################
559 # Job Configuration #
560 #####################
566 - shell: !include-raw-escape:
567 - ../shell/git-validate-jira-urls.sh
568 - ../shell/jjb-install.sh
569 - ../shell/jjb-verify-job.sh
570 - ../shell/jjb-check-unicode.sh
571 - lf-infra-gpg-verify-git-signature
574 name: '{project-name}-jjb-verify'
575 id: gerrit-jjb-verify
577 # yamllint disable-line rule:key-duplicates
580 git-url: '$GIT_URL/$GERRIT_PROJECT'
583 - lf-infra-gerrit-scm:
585 refspec: '$GERRIT_REFSPEC'
586 branch: '$GERRIT_BRANCH'
587 submodule-recursive: '{submodule-recursive}'
588 choosing-strategy: gerrit
589 jenkins-ssh-credential: '{jenkins-ssh-credential}'
593 server-name: '{gerrit-server-name}'
594 trigger-on: '{obj:gerrit_verify_triggers}'
596 - project-compare-type: ANT
597 project-pattern: '{project}'
599 - branch-compare-type: ANT
600 branch-pattern: '**/{branch}'
601 file-paths: '{obj:gerrit_trigger_file_paths}'
604 name: '{project-name}-jjb-verify'
605 id: github-jjb-verify
607 # yamllint disable-line rule:key-duplicates
612 url: '{git-url}/{github-org}/{project}'
615 - lf-infra-github-scm:
616 url: '{git-clone-url}{github-org}/{project}'
617 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
619 submodule-recursive: '{submodule-recursive}'
620 choosing-strategy: default
621 jenkins-ssh-credential: '{jenkins-ssh-credential}'
624 - lf-infra-github-pr-trigger:
625 trigger-phrase: '^recheck$'
626 only-trigger-phrase: false
627 status-context: 'JJB Verify'
633 github_pr_admin_list:
640 - lf_packer_merge: &lf_packer_merge
641 name: lf-packer-merge
643 # Packer Merge job runs `packer build` to build system images in the cloud.
645 # Required parameters:
647 # :build-node: The node to run build on.
648 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
649 # be configured in defaults.yaml)
650 # :mvn-settings: The name of settings file containing credentials for
652 # :platforms: Platform or distribution to build. Typically json file
653 # found in the packer/vars directory. (Example: centos)
654 # :template: System template to build. Typically shell script found in
655 # the packer/provision directory. (Example: java-builder)
657 # Optional parameters:
659 # :branch: Git branch to fetch for the build. (default: master)
660 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
661 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
662 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
663 # :packer-cloud-settings: Name of settings file containing credentials
664 # for the cloud that packer will build on. (default: packer-cloud-env)
665 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
666 # :stream: Keyword that can be used to represent a release code-name.
667 # Often the same as the branch. (default: master)
668 # :submodule-recursive: Whether to checkout submodules recursively.
671 # :gerrit_verify_triggers: Override Gerrit Triggers.
673 ######################
674 # Default parameters #
675 ######################
677 gerrit_merge_triggers:
678 - change-merged-event
679 - comment-added-contains-event:
680 comment-contains-value: remerge$
682 #####################
683 # Job Configuration #
684 #####################
687 - lf-infra-packer-validate:
688 packer-cloud-settings: '{packer-cloud-settings}'
689 packer-version: '{packer-version}'
690 - lf-infra-packer-build:
691 packer-cloud-settings: '{packer-cloud-settings}'
692 packer-version: '{packer-version}'
693 platform: '{platforms}'
694 template: '{templates}'
697 name: '{project-name}-packer-merge-{platforms}-{templates}'
698 id: gerrit-packer-merge
699 <<: *lf_packer_common
700 # yamllint disable-line rule:key-duplicates
703 git-url: '$GIT_URL/$GERRIT_PROJECT'
706 - lf-infra-gerrit-scm:
708 refspec: '$GERRIT_REFSPEC'
709 branch: '$GERRIT_BRANCH'
710 submodule-recursive: '{submodule-recursive}'
711 choosing-strategy: gerrit
712 jenkins-ssh-credential: '{jenkins-ssh-credential}'
715 - timed: '00 10 1 * *'
717 server-name: '{gerrit-server-name}'
718 trigger-on: '{obj:gerrit_merge_triggers}'
720 - project-compare-type: ANT
721 project-pattern: '{project}'
723 - branch-compare-type: ANT
724 branch-pattern: '**/{branch}'
725 <<: *lf_packer_file_paths
728 name: '{project-name}-packer-merge-{platforms}-{templates}'
729 id: github-packer-merge
730 <<: *lf_packer_common
731 # yamllint disable-line rule:key-duplicates
736 url: '{git-url}/{github-org}/{project}'
739 - lf-infra-github-scm:
740 url: '{git-clone-url}{github-org}/{project}'
743 submodule-recursive: '{submodule-recursive}'
744 choosing-strategy: default
745 jenkins-ssh-credential: '{jenkins-ssh-credential}'
748 - timed: '00 10 1 * *'
752 - lf-infra-github-pr-trigger:
753 trigger-phrase: '^remerge$'
754 only-trigger-phrase: true
755 status-context: 'Packer {platforms}-${templates} Merge'
758 github-org: '{github-org}'
759 github_pr_whitelist: '{obj:github_pr_whitelist}'
760 github_pr_admin_list: '{obj:github_pr_admin_list}'
766 - lf_packer_verify: &lf_packer_verify
767 name: lf-packer-verify
769 # Packer Verify job runs `packer validate` to verify packer configuration.
771 # Required parameters:
773 # :build-node: The node to run build on.
774 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
775 # be configured in defaults.yaml)
776 # :mvn-settings: The name of settings file containing credentials for
779 # Optional parameters:
781 # :branch: Git branch to fetch for the build. (default: master)
782 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
783 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
784 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
785 # :packer-cloud-settings: Name of settings file containing credentials
786 # for the cloud that packer will build on. (default: packer-cloud-env)
787 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
788 # :stream: Keyword that can be used to represent a release code-name.
789 # Often the same as the branch. (default: master)
790 # :submodule-recursive: Whether to checkout submodules recursively.
793 # :gerrit_verify_triggers: Override Gerrit Triggers.
794 # :gerrit_trigger_file_paths: Override file paths which can be used to
795 # filter which file modifications will trigger a build.
797 ######################
798 # Default parameters #
799 ######################
803 gerrit_verify_triggers:
804 - patchset-created-event:
806 exclude-trivial-rebase: false
807 exclude-no-code-change: false
808 - draft-published-event
809 - comment-added-contains-event:
810 comment-contains-value: recheck$
812 gerrit_trigger_file_paths:
814 pattern: 'packer/vars/**.json'
816 pattern: 'packer/templates/**.json'
818 pattern: 'packer/provision/**.sh'
820 pattern: 'packer/provision/lib/**'
822 #####################
823 # Job Configuration #
824 #####################
829 - lf-infra-packer-validate:
830 packer-cloud-settings: '{packer-cloud-settings}'
831 packer-version: '{packer-version}'
834 name: '{project-name}-packer-verify'
835 id: gerrit-packer-verify
836 <<: *lf_packer_common
837 # yamllint disable-line rule:key-duplicates
838 <<: *lf_packer_verify
840 git-url: '$GIT_URL/$GERRIT_PROJECT'
843 - lf-infra-gerrit-scm:
845 refspec: '$GERRIT_REFSPEC'
846 branch: '$GERRIT_BRANCH'
847 submodule-recursive: '{submodule-recursive}'
848 choosing-strategy: gerrit
849 jenkins-ssh-credential: '{jenkins-ssh-credential}'
853 server-name: '{gerrit-server-name}'
854 trigger-on: '{obj:gerrit_verify_triggers}'
856 - project-compare-type: ANT
857 project-pattern: '{project}'
859 - branch-compare-type: ANT
860 branch-pattern: '**/{branch}'
861 file-paths: '{obj:gerrit_trigger_file_paths}'
864 name: '{project-name}-packer-verify'
865 id: github-packer-verify
866 <<: *lf_packer_common
867 # yamllint disable-line rule:key-duplicates
868 <<: *lf_packer_verify
872 url: '{git-url}/{github-org}/{project}'
875 - lf-infra-github-scm:
876 url: '{git-clone-url}{github-org}/{project}'
877 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
879 submodule-recursive: '{submodule-recursive}'
880 choosing-strategy: default
881 jenkins-ssh-credential: '{jenkins-ssh-credential}'
884 - lf-infra-github-pr-trigger:
885 trigger-phrase: '^recheck$'
886 only-trigger-phrase: false
887 status-context: 'Packer Verify'
893 github_pr_admin_list: