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_verify_file_paths: &lf_packer_verify_file_paths
76 name: lf-packer-verify-file-paths
78 # Common files for all projects
80 pattern: 'packer/vars/**.json'
82 pattern: 'packer/templates/**.json'
84 pattern: 'packer/provision/**.sh'
86 pattern: 'packer/provision/lib/**'
88 - lf_packer_file_paths: &lf_packer_file_paths
89 name: lf-packer-file-paths
91 # Common files for all projects
93 pattern: 'packer/vars/{platforms}.json'
95 pattern: 'packer/templates/{templates}.json'
97 pattern: 'packer/provision/{templates}.sh'
99 pattern: 'packer/provision/lib/**'
101 - lf_packer: &lf_packer_common
102 name: lf-packer-common
103 # Provide configuration common in packer jobs.
105 ######################
106 # Default parameters #
107 ######################
112 submodule-recursive: true
113 packer-cloud-settings: packer-cloud-env
115 #####################
116 # Job Configuration #
117 #####################
119 project-type: freestyle
123 - lf-infra-properties:
125 build-days-to-keep: 7
128 - lf-infra-parameters:
132 lftools-version: '{lftools-version}'
133 - lf-infra-packer-parameters:
134 packer-version: '{packer-version}'
138 build-timeout: '{build-timeout}'
139 jenkins-ssh-credential: '{jenkins-ssh-credential}'
145 name: lf-infra-jjb-parameters
149 default: '{jjb-version}'
150 description: Jenkins Job Builder version to download and install.
153 name: lf-infra-packer-parameters
157 default: '{packer-version}'
158 description: Packer version to download and install.
160 - lf_jjb_common: &lf_jjb_common
163 ######################
164 # Default parameters #
165 ######################
170 submodule-recursive: true
172 gerrit_trigger_file_paths:
178 pattern: '**/global-jjb'
180 #####################
181 # Job Configuration #
182 #####################
184 project-type: freestyle
188 - lf-infra-properties:
190 build-days-to-keep: 7
193 - lf-infra-parameters:
197 lftools-version: '{lftools-version}'
198 - lf-infra-jjb-parameters:
199 jjb-version: '{jjb-version}'
203 build-timeout: '{build-timeout}'
204 jenkins-ssh-credential: '{jenkins-ssh-credential}'
209 ######################
210 # Gerrit Branch Lock #
211 ######################
214 name: '{project-name}-gerrit-branch-lock-{stream}'
215 id: gerrit-branch-lock
217 ######################
218 # Default parameters #
219 ######################
222 git-url: '$GIT_URL/$GERRIT_PROJECT'
224 gerrit_merge_triggers:
225 - comment-added-contains-event:
226 comment-contains-value: (un)?lock branch$
228 #####################
229 # Job Configuration #
230 #####################
232 project-type: freestyle
236 - lf-infra-properties:
238 build-days-to-keep: 1
241 - lf-infra-parameters:
245 lftools-version: '{lftools-version}'
250 jenkins-ssh-credential: '{jenkins-ssh-credential}'
253 - lf-infra-gerrit-scm:
257 submodule-recursive: false
258 choosing-strategy: default
259 jenkins-ssh-credential: '{jenkins-ssh-credential}'
263 server-name: '{gerrit-server-name}'
264 trigger-on: '{obj:gerrit_merge_triggers}'
266 - project-compare-type: ANT
267 project-pattern: '{project}'
269 - branch-compare-type: ANT
270 branch-pattern: '**/{branch}'
273 - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
283 - lf_jjb_deploy_job: &lf_jjb_deploy_job
284 name: lf-jjb-deploy-job
286 # Deploy jobs to jenkins-sandbox system via code review comment
288 # This job checks out the current code review patch and then runs a
289 # `jenkins-jobs update` to push a patch defined by the comment.
291 # Comment Trigger: jjb-deploy JOB_NAME
293 # JOB_NAME can include the * wildcard character to push multiple jobs
294 # matching the pattern. For example `jjb-deploy builder-jjb-*`` will push
295 # all builder-jjb-* jobs to the sandbox system.
297 # Required parameters:
299 # :build-node: The node to run build on.
300 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
301 # be configured in defaults.yaml)
303 # Optional parameters:
305 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
306 # :gerrit_jjb_deploy_job_triggers: Override Gerrit Triggers.
308 ######################
309 # Default parameters #
310 ######################
313 git-url: '$GIT_URL/$GERRIT_PROJECT'
315 gerrit_jjb_deploy_job_triggers:
316 - comment-added-contains-event:
317 comment-contains-value: jjb-deploy (?!\*+$).+$
319 #####################
320 # Job Configuration #
321 #####################
323 project-type: freestyle
328 - lf-infra-properties:
330 build-days-to-keep: 1
333 - lf-infra-parameters:
337 lftools-version: '{lftools-version}'
342 jenkins-ssh-credential: '{jenkins-ssh-credential}'
346 pip-packages: jenkins-job-builder
347 - lf-infra-jjbini-sandbox
348 - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
354 name: '{project-name}-jjb-deploy-job'
355 id: gerrit-jjb-deploy-job
356 <<: *lf_jjb_deploy_job
359 - lf-infra-gerrit-scm:
361 refspec: 'refs/heads/{branch}'
363 submodule-recursive: true
364 choosing-strategy: default
365 jenkins-ssh-credential: '{jenkins-ssh-credential}'
369 server-name: '{gerrit-server-name}'
370 trigger-on: '{obj:gerrit_jjb_deploy_job_triggers}'
372 - project-compare-type: ANT
373 project-pattern: '{project}'
375 - branch-compare-type: ANT
376 branch-pattern: '**/{branch}'
379 name: '{project-name}-jjb-deploy-job'
380 id: github-jjb-deploy-job
381 <<: *lf_jjb_deploy_job
385 url: '{git-url}/{github-org}/{project}'
388 - lf-infra-github-scm:
389 url: '{git-clone-url}{github-org}/{project}'
390 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
392 submodule-recursive: true
393 choosing-strategy: default
394 jenkins-ssh-credential: '{jenkins-ssh-credential}'
397 - lf-infra-github-pr-trigger:
398 trigger-phrase: '^jjb-deploy (?!\*+$).+$'
399 only-trigger-phrase: true
400 status-context: 'JJB Deploy Job'
406 github_pr_admin_list:
413 - lf_jjb_merge: &lf_jjb_merge
416 # JJB Merge job runs `jenkins-jobs update` to update production job configuration
418 # Required parameters:
420 # :build-node: The node to run build on.
421 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
422 # be configured in defaults.yaml)
423 # :mvn-settings: The name of settings file containing credentials for
426 # Optional parameters:
428 # :branch: Git branch to fetch for the build. (default: master)
429 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
430 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
431 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
432 # :stream: Keyword that can be used to represent a release code-name.
433 # Often the same as the branch. (default: master)
434 # :submodule-recursive: Whether to checkout submodules recursively.
437 # :gerrit_merge_triggers: Override Gerrit Triggers.
438 # :gerrit_trigger_file_paths: Override file paths which can be used to
439 # filter which file modifications will trigger a build.
440 # (default defined by lf_jjb_common)
442 ######################
443 # Default parameters #
444 ######################
446 gerrit_merge_triggers:
447 - change-merged-event
448 - comment-added-contains-event:
449 comment-contains-value: remerge$
451 #####################
452 # Job Configuration #
453 #####################
457 - shell: !include-raw-escape:
458 - ../shell/jjb-install.sh
459 - ../shell/jjb-merge-job.sh
462 name: '{project-name}-jjb-merge'
465 # yamllint disable-line rule:key-duplicates
468 git-url: '$GIT_URL/$GERRIT_PROJECT'
471 - lf-infra-gerrit-scm:
475 submodule-recursive: '{submodule-recursive}'
476 choosing-strategy: default
477 jenkins-ssh-credential: '{jenkins-ssh-credential}'
481 server-name: '{gerrit-server-name}'
482 trigger-on: '{obj:gerrit_merge_triggers}'
484 - project-compare-type: ANT
485 project-pattern: '{project}'
487 - branch-compare-type: ANT
488 branch-pattern: '**/{branch}'
489 file-paths: '{obj:gerrit_trigger_file_paths}'
492 name: '{project-name}-jjb-merge'
495 # yamllint disable-line rule:key-duplicates
500 url: '{git-url}/{github-org}/{project}'
503 - lf-infra-github-scm:
504 url: '{git-clone-url}{github-org}/{project}'
507 submodule-recursive: '{submodule-recursive}'
508 choosing-strategy: default
509 jenkins-ssh-credential: '{jenkins-ssh-credential}'
515 - lf-infra-github-pr-trigger:
516 trigger-phrase: '^remerge$'
517 only-trigger-phrase: true
518 status-context: 'JJB Merge'
521 github-org: '{github-org}'
522 github_pr_whitelist: '{obj:github_pr_whitelist}'
523 github_pr_admin_list: '{obj:github_pr_admin_list}'
529 - lf_jjb_verify: &lf_jjb_verify
532 # JJB Verify job runs `jenkins-jobs test` to validate JJB syntax
534 # Required parameters:
536 # :build-node: The node to run build on.
537 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
538 # be configured in defaults.yaml)
539 # :mvn-settings: The name of settings file containing credentials for
542 # Optional parameters:
544 # :branch: Git branch to fetch for the build. (default: master)
545 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
546 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
547 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
548 # :stream: Keyword that can be used to represent a release code-name.
549 # Often the same as the branch. (default: master)
550 # :submodule-recursive: Whether to checkout submodules recursively.
553 # :gerrit_verify_triggers: Override Gerrit Triggers.
554 # :gerrit_trigger_file_paths: Override file paths which can be used to
555 # filter which file modifications will trigger a build.
556 # (default defined by lf_jjb_common)
558 ######################
559 # Default parameters #
560 ######################
562 gerrit_verify_triggers:
563 - patchset-created-event:
565 exclude-trivial-rebase: false
566 exclude-no-code-change: false
567 - draft-published-event
568 - comment-added-contains-event:
569 comment-contains-value: recheck$
571 #####################
572 # Job Configuration #
573 #####################
579 - shell: !include-raw-escape:
580 - ../shell/git-validate-jira-urls.sh
581 - ../shell/jjb-install.sh
582 - ../shell/jjb-verify-job.sh
583 - ../shell/jjb-check-unicode.sh
584 - lf-infra-gpg-verify-git-signature
587 name: '{project-name}-jjb-verify'
588 id: gerrit-jjb-verify
590 # yamllint disable-line rule:key-duplicates
593 git-url: '$GIT_URL/$GERRIT_PROJECT'
596 - lf-infra-gerrit-scm:
598 refspec: '$GERRIT_REFSPEC'
599 branch: '$GERRIT_BRANCH'
600 submodule-recursive: '{submodule-recursive}'
601 choosing-strategy: gerrit
602 jenkins-ssh-credential: '{jenkins-ssh-credential}'
606 server-name: '{gerrit-server-name}'
607 trigger-on: '{obj:gerrit_verify_triggers}'
609 - project-compare-type: ANT
610 project-pattern: '{project}'
612 - branch-compare-type: ANT
613 branch-pattern: '**/{branch}'
614 file-paths: '{obj:gerrit_trigger_file_paths}'
617 name: '{project-name}-jjb-verify'
618 id: github-jjb-verify
620 # yamllint disable-line rule:key-duplicates
625 url: '{git-url}/{github-org}/{project}'
628 - lf-infra-github-scm:
629 url: '{git-clone-url}{github-org}/{project}'
630 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
632 submodule-recursive: '{submodule-recursive}'
633 choosing-strategy: default
634 jenkins-ssh-credential: '{jenkins-ssh-credential}'
637 - lf-infra-github-pr-trigger:
638 trigger-phrase: '^recheck$'
639 only-trigger-phrase: false
640 status-context: 'JJB Verify'
646 github_pr_admin_list:
653 - lf_packer_merge: &lf_packer_merge
654 name: lf-packer-merge
656 # Packer Merge job runs `packer build` to build system images in the cloud.
658 # Required parameters:
660 # :build-node: The node to run build on.
661 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
662 # be configured in defaults.yaml)
663 # :mvn-settings: The name of settings file containing credentials for
665 # :platforms: Platform or distribution to build. Typically json file
666 # found in the packer/vars directory. (Example: centos)
667 # :template: System template to build. Typically shell script found in
668 # the packer/provision directory. (Example: java-builder)
670 # Optional parameters:
672 # :branch: Git branch to fetch for the build. (default: master)
673 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
674 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
675 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
676 # :packer-cloud-settings: Name of settings file containing credentials
677 # for the cloud that packer will build on. (default: packer-cloud-env)
678 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
679 # :stream: Keyword that can be used to represent a release code-name.
680 # Often the same as the branch. (default: master)
681 # :submodule-recursive: Whether to checkout submodules recursively.
684 # :gerrit_verify_triggers: Override Gerrit Triggers.
685 # :gerrit_trigger_file_paths: Override file paths which can be used to
686 # filter which file modifications will trigger a build.
687 # (default defined by lf_jjb_common)
689 ######################
690 # Default parameters #
691 ######################
693 gerrit_merge_triggers:
694 - change-merged-event
695 - comment-added-contains-event:
696 comment-contains-value: remerge$
698 #####################
699 # Job Configuration #
700 #####################
703 - lf-infra-packer-validate:
704 packer-cloud-settings: '{packer-cloud-settings}'
705 packer-version: '{packer-version}'
706 - lf-infra-packer-build:
707 packer-cloud-settings: '{packer-cloud-settings}'
708 packer-version: '{packer-version}'
709 platform: '{platforms}'
710 template: '{templates}'
713 name: '{project-name}-packer-merge-{platforms}-{templates}'
714 id: gerrit-packer-merge
715 <<: *lf_packer_common
716 # yamllint disable-line rule:key-duplicates
719 git-url: '$GIT_URL/$GERRIT_PROJECT'
722 - lf-infra-gerrit-scm:
724 refspec: '$GERRIT_REFSPEC'
725 branch: '$GERRIT_BRANCH'
726 submodule-recursive: '{submodule-recursive}'
727 choosing-strategy: gerrit
728 jenkins-ssh-credential: '{jenkins-ssh-credential}'
731 - timed: '00 10 1 * *'
733 server-name: '{gerrit-server-name}'
734 trigger-on: '{obj:gerrit_merge_triggers}'
736 - project-compare-type: ANT
737 project-pattern: '{project}'
739 - branch-compare-type: ANT
740 branch-pattern: '**/{branch}'
741 <<: *lf_packer_file_paths
744 name: '{project-name}-packer-merge-{platforms}-{templates}'
745 id: github-packer-merge
746 <<: *lf_packer_common
747 # yamllint disable-line rule:key-duplicates
752 url: '{git-url}/{github-org}/{project}'
755 - lf-infra-github-scm:
756 url: '{git-clone-url}{github-org}/{project}'
759 submodule-recursive: '{submodule-recursive}'
760 choosing-strategy: default
761 jenkins-ssh-credential: '{jenkins-ssh-credential}'
764 - timed: '00 10 1 * *'
768 - lf-infra-github-pr-trigger:
769 trigger-phrase: '^remerge$'
770 only-trigger-phrase: true
771 status-context: 'Packer {platforms}-${templates} Merge'
774 github-org: '{github-org}'
775 github_pr_whitelist: '{obj:github_pr_whitelist}'
776 github_pr_admin_list: '{obj:github_pr_admin_list}'
782 - lf_packer_verify: &lf_packer_verify
783 name: lf-packer-verify
785 # Packer Verify job runs `packer validate` to verify packer configuration.
787 # Required parameters:
789 # :build-node: The node to run build on.
790 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
791 # be configured in defaults.yaml)
792 # :mvn-settings: The name of settings file containing credentials for
795 # Optional parameters:
797 # :branch: Git branch to fetch for the build. (default: master)
798 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
799 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
800 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
801 # :packer-cloud-settings: Name of settings file containing credentials
802 # for the cloud that packer will build on. (default: packer-cloud-env)
803 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
804 # :stream: Keyword that can be used to represent a release code-name.
805 # Often the same as the branch. (default: master)
806 # :submodule-recursive: Whether to checkout submodules recursively.
809 # :gerrit_verify_triggers: Override Gerrit Triggers.
810 # :gerrit_trigger_file_paths: Override file paths which can be used to
811 # filter which file modifications will trigger a build.
812 # (default defined by lf_jjb_common)
814 ######################
815 # Default parameters #
816 ######################
820 gerrit_verify_triggers:
821 - patchset-created-event:
823 exclude-trivial-rebase: false
824 exclude-no-code-change: false
825 - draft-published-event
826 - comment-added-contains-event:
827 comment-contains-value: recheck$
829 #####################
830 # Job Configuration #
831 #####################
836 - lf-infra-packer-validate:
837 packer-cloud-settings: '{packer-cloud-settings}'
838 packer-version: '{packer-version}'
841 name: '{project-name}-packer-verify'
842 id: gerrit-packer-verify
843 <<: *lf_packer_common
844 # yamllint disable-line rule:key-duplicates
845 <<: *lf_packer_verify
847 git-url: '$GIT_URL/$GERRIT_PROJECT'
850 - lf-infra-gerrit-scm:
852 refspec: '$GERRIT_REFSPEC'
853 branch: '$GERRIT_BRANCH'
854 submodule-recursive: '{submodule-recursive}'
855 choosing-strategy: gerrit
856 jenkins-ssh-credential: '{jenkins-ssh-credential}'
860 server-name: '{gerrit-server-name}'
861 trigger-on: '{obj:gerrit_verify_triggers}'
863 - project-compare-type: ANT
864 project-pattern: '{project}'
866 - branch-compare-type: ANT
867 branch-pattern: '**/{branch}'
868 <<: *lf_packer_verify_file_paths
871 name: '{project-name}-packer-verify'
872 id: github-packer-verify
873 <<: *lf_packer_common
874 # yamllint disable-line rule:key-duplicates
875 <<: *lf_packer_verify
879 url: '{git-url}/{github-org}/{project}'
882 - lf-infra-github-scm:
883 url: '{git-clone-url}{github-org}/{project}'
884 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
886 submodule-recursive: '{submodule-recursive}'
887 choosing-strategy: default
888 jenkins-ssh-credential: '{jenkins-ssh-credential}'
891 - lf-infra-github-pr-trigger:
892 trigger-phrase: '^recheck$'
893 only-trigger-phrase: false
894 status-context: 'Packer Verify'
900 github_pr_admin_list: