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.
672 # :gerrit_trigger_file_paths: Override file paths which can be used to
673 # filter which file modifications will trigger a build.
674 # (default defined by lf_jjb_common)
676 ######################
677 # Default parameters #
678 ######################
680 gerrit_merge_triggers:
681 - change-merged-event
682 - comment-added-contains-event:
683 comment-contains-value: remerge$
685 #####################
686 # Job Configuration #
687 #####################
690 - lf-infra-packer-validate:
691 packer-cloud-settings: '{packer-cloud-settings}'
692 packer-version: '{packer-version}'
693 - lf-infra-packer-build:
694 packer-cloud-settings: '{packer-cloud-settings}'
695 packer-version: '{packer-version}'
696 platform: '{platforms}'
697 template: '{templates}'
700 name: '{project-name}-packer-merge-{platforms}-{templates}'
701 id: gerrit-packer-merge
702 <<: *lf_packer_common
703 # yamllint disable-line rule:key-duplicates
706 git-url: '$GIT_URL/$GERRIT_PROJECT'
709 - lf-infra-gerrit-scm:
711 refspec: '$GERRIT_REFSPEC'
712 branch: '$GERRIT_BRANCH'
713 submodule-recursive: '{submodule-recursive}'
714 choosing-strategy: gerrit
715 jenkins-ssh-credential: '{jenkins-ssh-credential}'
718 - timed: '00 10 1 * *'
720 server-name: '{gerrit-server-name}'
721 trigger-on: '{obj:gerrit_merge_triggers}'
723 - project-compare-type: ANT
724 project-pattern: '{project}'
726 - branch-compare-type: ANT
727 branch-pattern: '**/{branch}'
728 <<: *lf_packer_file_paths
731 name: '{project-name}-packer-merge-{platforms}-{templates}'
732 id: github-packer-merge
733 <<: *lf_packer_common
734 # yamllint disable-line rule:key-duplicates
739 url: '{git-url}/{github-org}/{project}'
742 - lf-infra-github-scm:
743 url: '{git-clone-url}{github-org}/{project}'
746 submodule-recursive: '{submodule-recursive}'
747 choosing-strategy: default
748 jenkins-ssh-credential: '{jenkins-ssh-credential}'
751 - timed: '00 10 1 * *'
755 - lf-infra-github-pr-trigger:
756 trigger-phrase: '^remerge$'
757 only-trigger-phrase: true
758 status-context: 'Packer {platforms}-${templates} Merge'
761 github-org: '{github-org}'
762 github_pr_whitelist: '{obj:github_pr_whitelist}'
763 github_pr_admin_list: '{obj:github_pr_admin_list}'
769 - lf_packer_verify: &lf_packer_verify
770 name: lf-packer-verify
772 # Packer Verify job runs `packer validate` to verify packer configuration.
774 # Required parameters:
776 # :build-node: The node to run build on.
777 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
778 # be configured in defaults.yaml)
779 # :mvn-settings: The name of settings file containing credentials for
782 # Optional parameters:
784 # :branch: Git branch to fetch for the build. (default: master)
785 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
786 # :build-timeout: Timeout in seconds before aborting build. (default: 10)
787 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
788 # :packer-cloud-settings: Name of settings file containing credentials
789 # for the cloud that packer will build on. (default: packer-cloud-env)
790 # :packer-version: Version of packer to install / use in build. (default: 1.0.2)
791 # :stream: Keyword that can be used to represent a release code-name.
792 # Often the same as the branch. (default: master)
793 # :submodule-recursive: Whether to checkout submodules recursively.
796 # :gerrit_verify_triggers: Override Gerrit Triggers.
797 # :gerrit_trigger_file_paths: Override file paths which can be used to
798 # filter which file modifications will trigger a build.
799 # (default defined by lf_jjb_common)
801 ######################
802 # Default parameters #
803 ######################
807 gerrit_verify_triggers:
808 - patchset-created-event:
810 exclude-trivial-rebase: false
811 exclude-no-code-change: false
812 - draft-published-event
813 - comment-added-contains-event:
814 comment-contains-value: recheck$
816 #####################
817 # Job Configuration #
818 #####################
823 - lf-infra-packer-validate:
824 packer-cloud-settings: '{packer-cloud-settings}'
825 packer-version: '{packer-version}'
828 name: '{project-name}-packer-verify'
829 id: gerrit-packer-verify
830 <<: *lf_packer_common
831 # yamllint disable-line rule:key-duplicates
832 <<: *lf_packer_verify
834 git-url: '$GIT_URL/$GERRIT_PROJECT'
837 - lf-infra-gerrit-scm:
839 refspec: '$GERRIT_REFSPEC'
840 branch: '$GERRIT_BRANCH'
841 submodule-recursive: '{submodule-recursive}'
842 choosing-strategy: gerrit
843 jenkins-ssh-credential: '{jenkins-ssh-credential}'
847 server-name: '{gerrit-server-name}'
848 trigger-on: '{obj:gerrit_verify_triggers}'
850 - project-compare-type: ANT
851 project-pattern: '{project}'
853 - branch-compare-type: ANT
854 branch-pattern: '**/{branch}'
855 <<: *lf_packer_file_paths
858 name: '{project-name}-packer-verify'
859 id: github-packer-verify
860 <<: *lf_packer_common
861 # yamllint disable-line rule:key-duplicates
862 <<: *lf_packer_verify
866 url: '{git-url}/{github-org}/{project}'
869 - lf-infra-github-scm:
870 url: '{git-clone-url}{github-org}/{project}'
871 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
873 submodule-recursive: '{submodule-recursive}'
874 choosing-strategy: default
875 jenkins-ssh-credential: '{jenkins-ssh-credential}'
878 - lf-infra-github-pr-trigger:
879 trigger-phrase: '^recheck$'
880 only-trigger-phrase: false
881 status-context: 'Packer Verify'
887 github_pr_admin_list: