3 name: '{project-name}-ci-jobs'
6 - gerrit-jenkins-cfg-merge
7 - gerrit-jjb-deploy-job
12 name: '{project-name}-github-ci-jobs'
15 - github-jenkins-cfg-merge
16 - github-jjb-deploy-job
21 name: '{project-name}-info-yaml-jobs'
24 - gerrit-info-yaml-verify
27 name: '{project-name}-github-info-yaml-jobs'
30 - github-info-yaml-verify
33 name: '{project-name}-packer-jobs'
37 - gerrit-packer-verify
41 name: '{project-name}-github-packer-jobs'
45 - github-packer-verify
54 - config-file-provider:
57 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
60 name: lf-infra-jjbini-sandbox
61 # TODO: Consolidate this into jjbini when JJB2.0 is available.
63 - config-file-provider:
65 - file-id: jjbini-sandbox
66 target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
68 - lf_packer: &lf_packer_common
69 name: lf-packer-common
70 # Provide configuration common in packer jobs.
72 ######################
73 # Default parameters #
74 ######################
80 submodule-recursive: true
81 packer-cloud-settings: packer-cloud-env
88 project-type: freestyle
92 - lf-infra-properties:
97 - lf-infra-parameters:
101 lftools-version: '{lftools-version}'
102 - lf-packer-parameters:
103 packer-version: '{packer-version}'
107 build-timeout: '{build-timeout}'
108 jenkins-ssh-credential: '{jenkins-ssh-credential}'
114 name: lf-infra-jjb-parameters
118 default: '{jjb-version}'
119 description: Jenkins Job Builder version to download and install.
122 name: lf-packer-parameters
126 default: '{packer-version}'
127 description: Packer version to download and install.
129 - lf_jjb_common: &lf_jjb_common
132 ######################
133 # Default parameters #
134 ######################
140 submodule-recursive: true
142 gerrit_trigger_file_paths:
143 - compare-type: REG_EXP
144 pattern: '.*\.groovy'
145 - compare-type: REG_EXP
147 - compare-type: REG_EXP
149 - compare-type: REG_EXP
151 - compare-type: REG_EXP
152 pattern: '.*\.(yaml|yml)'
153 - compare-type: REG_EXP
154 pattern: '.*\/global-jjb'
156 # github_included_regions MUST match gerrit_trigger_file_paths
157 github_included_regions:
165 #####################
166 # Job Configuration #
167 #####################
169 project-type: freestyle
173 - lf-infra-properties:
175 build-days-to-keep: 7
178 - lf-infra-parameters:
182 lftools-version: '{lftools-version}'
183 - lf-infra-jjb-parameters:
184 jjb-version: '{jjb-version}'
188 build-timeout: '{build-timeout}'
189 jenkins-ssh-credential: '{jenkins-ssh-credential}'
194 ######################
195 # Gerrit Branch Lock #
196 ######################
199 name: '{project-name}-gerrit-branch-lock-{stream}'
200 id: gerrit-branch-lock
202 ######################
203 # Default parameters #
204 ######################
207 git-url: '$GIT_URL/$GERRIT_PROJECT'
209 gerrit_merge_triggers:
210 - comment-added-contains-event:
211 comment-contains-value: (un)?lock branch$
213 #####################
214 # Job Configuration #
215 #####################
217 project-type: freestyle
221 - lf-infra-properties:
223 build-days-to-keep: 1
226 - lf-infra-parameters:
230 lftools-version: '{lftools-version}'
235 jenkins-ssh-credential: '{jenkins-ssh-credential}'
238 - lf-infra-gerrit-scm:
242 submodule-recursive: false
243 choosing-strategy: default
244 jenkins-ssh-credential: '{jenkins-ssh-credential}'
248 server-name: '{gerrit-server-name}'
249 trigger-on: '{obj:gerrit_merge_triggers}'
251 - project-compare-type: ANT
252 project-pattern: '{project}'
254 - branch-compare-type: ANT
255 branch-pattern: '**/{branch}'
258 - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
264 ##########################################
265 # Jenkins Configuration Management Merge #
266 ##########################################
269 name: lf-jenkins-cfg-clouds
273 properties-content: 'jenkins_silos={jenkins-silos}'
274 - shell: !include-raw-escape: ../shell/jenkins-configure-clouds.sh
275 - shell: rm "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
278 name: lf-jenkins-cfg-global-vars
282 properties-content: 'jenkins_silos={jenkins-silos}'
283 - shell: !include-raw-escape: ../shell/jenkins-configure-global-vars.sh
284 - shell: rm "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
286 - lf_jenkins_configuration: &lf_jenkins_cfg_merge
287 name: lf-jenkins-cfg-merge
289 ######################
290 # Default parameters #
291 ######################
295 git-url: '$GIT_URL/$GERRIT_PROJECT'
296 jenkins-silos: production sandbox
298 gerrit_merge_triggers:
299 - change-merged-event
300 - comment-added-contains-event:
301 comment-contains-value: remerge$
303 gerrit_trigger_file_paths:
304 - compare-type: REG_EXP
305 pattern: 'jenkins-config\/.*'
307 # github_included_regions MUST match gerrit_trigger_file_paths
308 github_included_regions:
309 - 'jenkins-config\/.*'
311 #####################
312 # Job Configuration #
313 #####################
315 project-type: freestyle
320 - lf-infra-properties:
322 build-days-to-keep: 1
325 - lf-infra-parameters:
329 lftools-version: '{lftools-version}'
334 jenkins-ssh-credential: '{jenkins-ssh-credential}'
337 - shell: !include-raw-escape:
338 - ../shell/lftools-install.sh
339 - lf-jenkins-cfg-global-vars:
340 jenkins-silos: '{jenkins-silos}'
341 - lf-jenkins-cfg-clouds:
342 jenkins-silos: '{jenkins-silos}'
348 name: '{project-name}-jenkins-cfg-merge'
349 id: gerrit-jenkins-cfg-merge
350 <<: *lf_jenkins_cfg_merge
353 - lf-infra-gerrit-scm:
355 refspec: 'refs/heads/{branch}'
357 submodule-recursive: true
358 choosing-strategy: default
359 jenkins-ssh-credential: '{jenkins-ssh-credential}'
362 - timed: '{obj:cron}'
364 server-name: '{gerrit-server-name}'
365 trigger-on: '{obj:gerrit_merge_triggers}'
367 - project-compare-type: ANT
368 project-pattern: '{project}'
370 - branch-compare-type: ANT
371 branch-pattern: '**/{branch}'
372 file-paths: '{obj:gerrit_trigger_file_paths}'
375 name: '{project-name}-jenkins-cfg-merge'
376 id: github-jenkins-cfg-merge
377 <<: *lf_jenkins_cfg_merge
381 url: '{git-url}/{github-org}/{project}'
384 - lf-infra-github-scm:
385 url: '{git-clone-url}{github-org}/{project}'
387 branch: 'refs/heads/{branch}'
388 submodule-recursive: true
389 choosing-strategy: default
390 jenkins-ssh-credential: '{jenkins-ssh-credential}'
393 - timed: '{obj:cron}'
397 - github-pull-request:
398 trigger-phrase: '^remerge$'
399 only-trigger-phrase: true
400 status-context: 'Jenkins CFG Merge'
405 white-list: '{obj:github_pr_whitelist}'
406 admin-list: '{obj:github_pr_admin_list}'
407 included-regions: '{obj:github_included_regions}'
413 - lf_jjb_deploy_job: &lf_jjb_deploy_job
414 name: lf-jjb-deploy-job
416 ######################
417 # Default parameters #
418 ######################
421 # jjb-deploy should always clone $PROJECT regardless of what
422 # $GERRIT_PROJECT triggered the job.
423 git-url: '$GIT_URL/$PROJECT'
425 gerrit_jjb_deploy_job_triggers:
426 - comment-added-contains-event:
427 comment-contains-value: 'jjb-deploy[:]* (?!\*+$).+$'
429 #####################
430 # Job Configuration #
431 #####################
433 project-type: freestyle
438 - lf-infra-properties:
440 build-days-to-keep: 1
443 - lf-infra-parameters:
447 lftools-version: '{lftools-version}'
452 jenkins-ssh-credential: '{jenkins-ssh-credential}'
456 pip-packages: jenkins-job-builder
457 - lf-infra-jjbini-sandbox
458 - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
464 name: '{project-name}-jjb-deploy-job'
465 id: gerrit-jjb-deploy-job
466 <<: *lf_jjb_deploy_job
469 - lf-infra-gerrit-scm:
471 refspec: 'refs/heads/{branch}'
473 submodule-recursive: true
474 choosing-strategy: default
475 jenkins-ssh-credential: '{jenkins-ssh-credential}'
479 server-name: '{gerrit-server-name}'
480 trigger-on: '{obj:gerrit_jjb_deploy_job_triggers}'
482 - project-compare-type: ANT
483 project-pattern: '**'
485 - branch-compare-type: ANT
494 name: '{project-name}-jjb-deploy-job'
495 id: github-jjb-deploy-job
496 <<: *lf_jjb_deploy_job
500 url: '{git-url}/{github-org}/{project}'
503 - lf-infra-github-scm:
504 url: '{git-clone-url}{github-org}/{project}'
505 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
507 submodule-recursive: true
508 choosing-strategy: default
509 jenkins-ssh-credential: '{jenkins-ssh-credential}'
512 - github-pull-request:
513 trigger-phrase: '^jjb-deploy (?!\*+$).+$'
514 only-trigger-phrase: true
515 status-context: 'JJB Deploy Job'
523 - lf_jjb_merge: &lf_jjb_merge
526 ######################
527 # Default parameters #
528 ######################
530 gerrit_merge_triggers:
531 - change-merged-event
532 - comment-added-contains-event:
533 comment-contains-value: remerge$
535 #####################
536 # Job Configuration #
537 #####################
541 - shell: !include-raw-escape:
542 - ../shell/jjb-install.sh
543 - ../shell/jjb-merge-job.sh
544 - ../shell/jjb-cleanup.sh
547 name: '{project-name}-jjb-merge'
550 # yamllint disable-line rule:key-duplicates
553 git-url: '$GIT_URL/$GERRIT_PROJECT'
556 - lf-infra-gerrit-scm:
560 submodule-recursive: '{submodule-recursive}'
561 choosing-strategy: default
562 jenkins-ssh-credential: '{jenkins-ssh-credential}'
566 server-name: '{gerrit-server-name}'
567 trigger-on: '{obj:gerrit_merge_triggers}'
569 - project-compare-type: ANT
570 project-pattern: '{project}'
572 - branch-compare-type: ANT
573 branch-pattern: '**/{branch}'
574 file-paths: '{obj:gerrit_trigger_file_paths}'
577 name: '{project-name}-jjb-merge'
580 # yamllint disable-line rule:key-duplicates
583 #####################
584 # Job Configuration #
585 #####################
589 url: '{git-url}/{github-org}/{project}'
592 - lf-infra-github-scm:
593 url: '{git-clone-url}{github-org}/{project}'
595 branch: 'refs/heads/{branch}'
596 submodule-recursive: '{submodule-recursive}'
597 choosing-strategy: default
598 jenkins-ssh-credential: '{jenkins-ssh-credential}'
604 - github-pull-request:
605 trigger-phrase: '^remerge$'
606 only-trigger-phrase: true
607 status-context: 'JJB Merge'
612 white-list: '{obj:github_pr_whitelist}'
613 admin-list: '{obj:github_pr_admin_list}'
614 included-regions: '{obj:github_included_regions}'
620 - lf_jjb_verify: &lf_jjb_verify
623 ######################
624 # Default parameters #
625 ######################
627 gerrit_verify_triggers:
628 - patchset-created-event:
630 exclude-trivial-rebase: false
631 exclude-no-code-change: false
632 - draft-published-event
633 - comment-added-contains-event:
634 comment-contains-value: recheck$
636 #####################
637 # Job Configuration #
638 #####################
644 - shell: !include-raw-escape:
645 - ../shell/git-validate-jira-urls.sh
646 - ../shell/jjb-install.sh
647 - ../shell/jjb-verify-job.sh
648 - ../shell/jjb-check-unicode.sh
649 - ../shell/jjb-cleanup.sh
650 - lf-infra-gpg-verify-git-signature
653 name: '{project-name}-jjb-verify'
654 id: gerrit-jjb-verify
656 # yamllint disable-line rule:key-duplicates
659 ######################
660 # Default parameters #
661 ######################
663 git-url: '$GIT_URL/$GERRIT_PROJECT'
665 #####################
666 # Job Configuration #
667 #####################
670 - lf-infra-gerrit-scm:
672 refspec: '$GERRIT_REFSPEC'
673 branch: '$GERRIT_BRANCH'
674 submodule-recursive: '{submodule-recursive}'
675 choosing-strategy: gerrit
676 jenkins-ssh-credential: '{jenkins-ssh-credential}'
680 server-name: '{gerrit-server-name}'
681 trigger-on: '{obj:gerrit_verify_triggers}'
683 - project-compare-type: ANT
684 project-pattern: '{project}'
686 - branch-compare-type: ANT
687 branch-pattern: '**/{branch}'
688 file-paths: '{obj:gerrit_trigger_file_paths}'
691 name: '{project-name}-jjb-verify'
692 id: github-jjb-verify
694 # yamllint disable-line rule:key-duplicates
697 #####################
698 # Job Configuration #
699 #####################
703 url: '{git-url}/{github-org}/{project}'
706 - lf-infra-github-scm:
707 url: '{git-clone-url}{github-org}/{project}'
708 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
710 submodule-recursive: '{submodule-recursive}'
711 choosing-strategy: default
712 jenkins-ssh-credential: '{jenkins-ssh-credential}'
715 - github-pull-request:
716 trigger-phrase: '^recheck$'
717 only-trigger-phrase: false
718 status-context: 'JJB Verify'
721 included-regions: '{obj:github_included_regions}'
727 - lf_info_yaml_verify: &lf_info_yaml_verify
728 name: lf-info-yaml-verify
730 ######################
731 # Default parameters #
732 ######################
734 gerrit_verify_triggers:
735 - patchset-created-event:
737 exclude-trivial-rebase: false
738 exclude-no-code-change: false
739 - draft-published-event
740 - comment-added-contains-event:
741 comment-contains-value: recheck$
743 #####################
744 # Job Configuration #
745 #####################
750 - shell: !include-raw-escape:
751 - ../shell/git-validate-info-yaml.sh
752 - ../shell/info-file-validate.sh
755 name: '{project-name}-info-yaml-verify'
756 id: gerrit-info-yaml-verify
758 # yamllint disable-line rule:key-duplicates
759 <<: *lf_info_yaml_verify
761 git-url: '$GIT_URL/$GERRIT_PROJECT'
764 - lf-infra-gerrit-scm:
766 refspec: '$GERRIT_REFSPEC'
767 branch: '$GERRIT_BRANCH'
768 submodule-recursive: '{submodule-recursive}'
769 choosing-strategy: gerrit
770 jenkins-ssh-credential: '{jenkins-ssh-credential}'
774 server-name: '{gerrit-server-name}'
775 trigger-on: '{obj:gerrit_verify_triggers}'
777 - project-compare-type: ANT
778 project-pattern: '{project}'
780 - branch-compare-type: ANT
781 branch-pattern: '**/{branch}'
783 - compare-type: REG_EXP
787 name: '{project-name}-info-yaml-verify'
788 id: github-info-yaml-verify
790 # yamllint disable-line rule:key-duplicates
791 <<: *lf_info_yaml_verify
795 url: '{git-url}/{github-org}/{project}'
798 - lf-infra-github-scm:
799 url: '{git-clone-url}{github-org}/{project}'
800 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
802 submodule-recursive: '{submodule-recursive}'
803 choosing-strategy: default
804 jenkins-ssh-credential: '{jenkins-ssh-credential}'
807 - github-pull-request:
808 trigger-phrase: '^recheck$'
809 only-trigger-phrase: false
810 status-context: 'INFO File Verify'
813 # included-regions MUST match gerrit file-paths
814 included-regions: 'INFO.yaml'
820 - lf_packer_merge: &lf_packer_merge
821 name: lf-packer-merge
823 #####################
824 # Job Configuration #
825 #####################
828 - lf-infra-packer-validate:
829 packer-cloud-settings: '{packer-cloud-settings}'
830 packer-version: '{packer-version}'
831 - lf-infra-packer-build:
832 packer-cloud-settings: '{packer-cloud-settings}'
833 packer-version: '{packer-version}'
834 platform: '{platforms}'
835 template: '{templates}'
838 name: '{project-name}-packer-merge-{platforms}-{templates}'
839 id: gerrit-packer-merge
840 <<: *lf_packer_common
841 # yamllint disable-line rule:key-duplicates
844 ######################
845 # Default parameters #
846 ######################
848 git-url: '$GIT_URL/$GERRIT_PROJECT'
850 gerrit_merge_triggers:
851 - change-merged-event
852 - comment-added-contains-event:
853 comment-contains-value: remerge$
855 #####################
856 # Job Configuration #
857 #####################
860 - lf-infra-gerrit-scm:
862 refspec: '$GERRIT_REFSPEC'
863 branch: '$GERRIT_BRANCH'
864 submodule-recursive: '{submodule-recursive}'
865 choosing-strategy: gerrit
866 jenkins-ssh-credential: '{jenkins-ssh-credential}'
871 server-name: '{gerrit-server-name}'
872 trigger-on: '{obj:gerrit_merge_triggers}'
874 - project-compare-type: ANT
875 project-pattern: '{project}'
877 - branch-compare-type: ANT
878 branch-pattern: '**/{branch}'
880 - compare-type: REG_EXP
881 pattern: 'packer\/provision\/.*\.sh'
882 - compare-type: REG_EXP
883 pattern: 'packer\/provision\/.*\.bat'
884 - compare-type: REG_EXP
885 pattern: 'packer\/provision\/.*\.ps1'
886 - compare-type: REG_EXP
887 pattern: 'packer\/provision\/{templates}\.yaml'
888 - compare-type: REG_EXP
889 pattern: 'packer\/provision\/local-{templates}\.yaml'
890 - compare-type: REG_EXP
891 pattern: 'packer\/templates\/{templates}\.json'
892 - compare-type: REG_EXP
893 pattern: 'packer\/vars\/{platforms}\.json'
896 name: '{project-name}-packer-merge-{platforms}-{templates}'
897 id: github-packer-merge
898 <<: *lf_packer_common
899 # yamllint disable-line rule:key-duplicates
902 #####################
903 # Job Configuration #
904 #####################
908 url: '{git-url}/{github-org}/{project}'
911 - lf-infra-github-scm:
912 url: '{git-clone-url}{github-org}/{project}'
914 branch: 'refs/heads/{branch}'
915 submodule-recursive: '{submodule-recursive}'
916 choosing-strategy: default
917 jenkins-ssh-credential: '{jenkins-ssh-credential}'
925 - github-pull-request:
926 trigger-phrase: '^remerge$'
927 only-trigger-phrase: true
928 status-context: 'Packer {platforms}-{templates} Merge'
933 white-list: '{obj:github_pr_whitelist}'
934 admin-list: '{obj:github_pr_admin_list}'
935 # included-regions MUST match Gerrit Trigger file-paths
937 - 'packer\/provision\/.*\.sh'
938 - 'packer\/provision\/.*\.bat'
939 - 'packer\/provision\/.*\.ps1'
940 - 'packer\/provision\/{templates}\.yaml'
941 - 'packer\/provision\/local-{templates}\.yaml'
942 - 'packer\/templates\/{templates}\.json'
943 - 'packer\/vars\/{platforms}\.json'
949 - lf_packer_verify: &lf_packer_verify
950 name: lf-packer-verify
952 ######################
953 # Default parameters #
954 ######################
958 gerrit_verify_triggers:
959 - patchset-created-event:
961 exclude-trivial-rebase: false
962 exclude-no-code-change: false
963 - draft-published-event
964 - comment-added-contains-event:
965 comment-contains-value: recheck$
967 gerrit_trigger_file_paths:
968 - compare-type: REG_EXP
969 pattern: 'packer\/.*'
971 # github_included_regions MUST match gerrit_trigger_file_paths
972 github_included_regions:
975 #####################
976 # Job Configuration #
977 #####################
982 - lf-infra-packer-validate:
983 packer-cloud-settings: '{packer-cloud-settings}'
984 packer-version: '{packer-version}'
987 name: '{project-name}-packer-verify'
988 id: gerrit-packer-verify
989 <<: *lf_packer_common
990 # yamllint disable-line rule:key-duplicates
991 <<: *lf_packer_verify
993 ######################
994 # Default parameters #
995 ######################
997 git-url: '$GIT_URL/$GERRIT_PROJECT'
999 #####################
1000 # Job Configuration #
1001 #####################
1004 - lf-infra-gerrit-scm:
1005 git-url: '{git-url}'
1006 refspec: '$GERRIT_REFSPEC'
1007 branch: '$GERRIT_BRANCH'
1008 submodule-recursive: '{submodule-recursive}'
1009 choosing-strategy: gerrit
1010 jenkins-ssh-credential: '{jenkins-ssh-credential}'
1014 server-name: '{gerrit-server-name}'
1015 trigger-on: '{obj:gerrit_verify_triggers}'
1017 - project-compare-type: ANT
1018 project-pattern: '{project}'
1020 - branch-compare-type: ANT
1021 branch-pattern: '**/{branch}'
1022 file-paths: '{obj:gerrit_trigger_file_paths}'
1025 name: '{project-name}-packer-verify'
1026 id: github-packer-verify
1027 <<: *lf_packer_common
1028 # yamllint disable-line rule:key-duplicates
1029 <<: *lf_packer_verify
1031 #####################
1032 # Job Configuration #
1033 #####################
1037 url: '{git-url}/{github-org}/{project}'
1040 - lf-infra-github-scm:
1041 url: '{git-clone-url}{github-org}/{project}'
1042 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1044 submodule-recursive: '{submodule-recursive}'
1045 choosing-strategy: default
1046 jenkins-ssh-credential: '{jenkins-ssh-credential}'
1049 - github-pull-request:
1050 trigger-phrase: '^recheck$'
1051 only-trigger-phrase: false
1052 status-context: 'Packer Verify'
1055 included-regions: '{obj:github_included_regions}'