Add trigger-on-cron to docker merge job
[releng/global-jjb.git] / jjb / lf-ci-jobs.yaml
1 ---
2
3 ####################
4 # COMMON FUNCTIONS #
5 ####################
6
7 - builder:
8     name: lf-infra-jjbini
9     builders:
10       - config-file-provider:
11           files:
12             - file-id: jjbini
13               target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
14
15 - builder:
16     name: lf-infra-jjbini-sandbox
17     # TODO: Consolidate this into jjbini when JJB2.0 is available.
18     builders:
19       - config-file-provider:
20           files:
21             - file-id: jjbini-sandbox
22               target: '$HOME/.config/jenkins_jobs/jenkins_jobs.ini'
23
24 - lf_packer: &lf_packer_common
25     name: lf-packer-common
26     # Provide configuration common in packer jobs.
27
28     ######################
29     # Default parameters #
30     ######################
31
32     branch: master
33     build-timeout: 90
34     cron: '@monthly'
35     disable-job: false
36     github-url: 'https://github.com'
37     stream: master
38     submodule-recursive: true
39     submodule-timeout: 10
40     submodule-disable: false
41     packer-cloud-settings: packer-cloud-env
42     packer-version: 1.4.0
43
44     #####################
45     # Job Configuration #
46     #####################
47
48     project-type: freestyle
49     node: '{build-node}'
50     disabled: '{disable-job}'
51
52     properties:
53       - lf-infra-properties:
54           project: '{project}'
55           build-days-to-keep: 7
56
57     parameters:
58       - lf-infra-parameters:
59           project: '{project}'
60           stream: '{stream}'
61           branch: '{branch}'
62       - lf-packer-parameters:
63           packer-version: '{packer-version}'
64
65     wrappers:
66       - lf-infra-wrappers:
67           build-timeout: '{build-timeout}'
68           jenkins-ssh-credential: '{jenkins-ssh-credential}'
69
70     publishers:
71       - lf-infra-publish
72
73 - parameter:
74     name: lf-infra-jjb-parameters
75     parameters:
76       - string:
77           name: JJB_VERSION
78           default: '{jjb-version}'
79           description: Jenkins Job Builder version to download and install.
80       - string:
81           name: XDG_CACHE_HOME
82           default: '{jjb-cache}'
83           description: Jenkins Job Builder cache location.
84
85 - parameter:
86     name: lf-packer-parameters
87     parameters:
88       - string:
89           name: PACKER_VERSION
90           default: '{packer-version}'
91           description: Packer version to download and install.
92
93 - parameter:
94     name: lf-puppet-parameters
95     parameters:
96       - string:
97           name: PUPPET_LINT_VERSION
98           default: '{puppet-lint-version}'
99           description: Puppet-lint version to download and install.
100
101 - lf_jjb_common: &lf_jjb_common
102     name: lf-jjb-common
103
104     ######################
105     # Default parameters #
106     ######################
107
108     branch: master
109     build-timeout: 10
110     disable-job: false
111     github-url: 'https://github.com'
112     jjb-cache: '$HOME/.cache/jenkins_jobs'
113     jjb-version: 2.8.0
114     stream: master
115     submodule-recursive: true
116     submodule-timeout: 10
117     submodule-disable: false
118     throttle_categories: []
119     throttle-enabled: false
120     throttle-max-per-node: 1
121     throttle-max-total: 0
122     throttle-option: 'project'
123
124     gerrit_trigger_file_paths:
125       - compare-type: REG_EXP
126         pattern: 'jjb/.*'
127       - compare-type: REG_EXP
128         pattern: 'global-jjb'
129       - compare-type: REG_EXP
130         pattern: 'shell/.*'
131
132     # github_included_regions MUST match gerrit_trigger_file_paths
133     github_included_regions:
134       - 'jjb/.*'
135       - 'global-jjb'
136       - 'shell/.*'
137
138     #####################
139     # Job Configuration #
140     #####################
141
142     project-type: freestyle
143     node: '{build-node}'
144     disabled: '{disable-job}'
145
146     properties:
147       - lf-infra-properties:
148           project: '{project}'
149           build-days-to-keep: 7
150       - throttle:
151           categories: '{obj:throttle_categories}'
152           enabled: '{throttle-enabled}'
153           max-per-node: '{throttle-max-per-node}'
154           max-total: '{throttle-max-total}'
155           option: '{throttle-option}'
156
157     parameters:
158       - lf-infra-parameters:
159           project: '{project}'
160           stream: '{stream}'
161           branch: '{branch}'
162       - lf-infra-jjb-parameters:
163           jjb-cache: '{jjb-cache}'
164           jjb-version: '{jjb-version}'
165
166     wrappers:
167       - lf-infra-wrappers:
168           build-timeout: '{build-timeout}'
169           jenkins-ssh-credential: '{jenkins-ssh-credential}'
170
171     publishers:
172       - lf-infra-publish
173
174 ######################
175 # Gerrit Branch Lock #
176 ######################
177
178 - job-template:
179     name: '{project-name}-gerrit-branch-lock-{stream}'
180     id: gerrit-branch-lock
181
182     ######################
183     # Default parameters #
184     ######################
185
186     branch: master
187     disable-job: false
188     git-url: '$GIT_URL/$GERRIT_PROJECT'
189     stream: master
190     submodule-timeout: 10
191     submodule-disable: false
192     gerrit_merge_triggers:
193       - comment-added-contains-event:
194           comment-contains-value: (un)?lock branch$
195
196     #####################
197     # Job Configuration #
198     #####################
199
200     project-type: freestyle
201     node: '{build-node}'
202     disabled: '{disable-job}'
203
204     properties:
205       - lf-infra-properties:
206           project: '{project}'
207           build-days-to-keep: 1
208
209     parameters:
210       - lf-infra-parameters:
211           project: '{project}'
212           stream: '{stream}'
213           branch: '{branch}'
214
215     wrappers:
216       - lf-infra-wrappers:
217           build-timeout: 5
218           jenkins-ssh-credential: '{jenkins-ssh-credential}'
219
220     scm:
221       - lf-infra-gerrit-scm:
222           git-url: '{git-url}'
223           refspec: ''
224           branch: '{branch}'
225           submodule-recursive: false
226           submodule-timeout: '{submodule-timeout}'
227           submodule-disable: '{submodule-disable}'
228           choosing-strategy: default
229           jenkins-ssh-credential: '{jenkins-ssh-credential}'
230
231     triggers:
232       - gerrit:
233           server-name: '{gerrit-server-name}'
234           trigger-on: '{obj:gerrit_merge_triggers}'
235           projects:
236             - project-compare-type: ANT
237               project-pattern: '{project}'
238               branches:
239                 - branch-compare-type: ANT
240                   branch-pattern: '**/{branch}'
241
242     builders:
243       - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
244
245
246     publishers:
247       - lf-infra-publish
248
249 ##########################################
250 # Jenkins Configuration Management Merge #
251 ##########################################
252
253 - builder:
254     name: lf-jenkins-cfg-clouds
255     builders:
256       - lf-infra-jjbini
257       - inject:
258           properties-content: 'jenkins_silos={jenkins-silos}'
259       - shell: !include-raw-escape: ../shell/jenkins-configure-clouds.sh
260       - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
261
262 - builder:
263     name: lf-jenkins-cfg-global-vars
264     builders:
265       - lf-infra-jjbini
266       - inject:
267           properties-content: 'jenkins_silos={jenkins-silos}'
268       - shell: !include-raw-escape: ../shell/jenkins-configure-global-vars.sh
269       - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
270
271 - lf_jenkins_configuration: &lf_jenkins_cfg_merge
272     name: lf-jenkins-cfg-merge
273
274     ######################
275     # Default parameters #
276     ######################
277
278     branch: master
279     cron: '@daily'
280     disable-job: false
281     git-url: '$GIT_URL/$GERRIT_PROJECT'
282     github-url: 'https://github.com'
283     jenkins-silos: production sandbox
284     submodule-timeout: 10
285     submodule-disable: false
286
287     gerrit_merge_triggers:
288       - change-merged-event
289       - comment-added-contains-event:
290           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
291
292     gerrit_trigger_file_paths:
293       - compare-type: REG_EXP
294         pattern: 'jenkins-config\/.*'
295
296     # github_included_regions MUST match gerrit_trigger_file_paths
297     github_included_regions:
298       - 'jenkins-config\/.*'
299
300     #####################
301     # Job Configuration #
302     #####################
303
304     project-type: freestyle
305     node: '{build-node}'
306     concurrent: false
307     disabled: '{disable-job}'
308
309     properties:
310       - lf-infra-properties:
311           project: '{project}'
312           build-days-to-keep: 1
313
314     parameters:
315       - lf-infra-parameters:
316           project: '{project}'
317           stream: ''
318           branch: master
319
320     wrappers:
321       - lf-infra-wrappers:
322           build-timeout: 10
323           jenkins-ssh-credential: '{jenkins-ssh-credential}'
324
325     builders:
326       - lf-infra-pre-build
327       - lf-jenkins-cfg-global-vars:
328           jenkins-silos: '{jenkins-silos}'
329       - lf-jenkins-cfg-clouds:
330           jenkins-silos: '{jenkins-silos}'
331
332     publishers:
333       - lf-infra-publish
334
335 - job-template:
336     name: '{project-name}-jenkins-cfg-merge'
337     id: gerrit-jenkins-cfg-merge
338     <<: *lf_jenkins_cfg_merge
339
340     scm:
341       - lf-infra-gerrit-scm:
342           git-url: '{git-url}'
343           refspec: 'refs/heads/{branch}'
344           branch: '{branch}'
345           submodule-recursive: true
346           submodule-timeout: '{submodule-timeout}'
347           submodule-disable: '{submodule-disable}'
348           choosing-strategy: default
349           jenkins-ssh-credential: '{jenkins-ssh-credential}'
350
351     triggers:
352       - timed: '{obj:cron}'
353       - gerrit:
354           server-name: '{gerrit-server-name}'
355           trigger-on: '{obj:gerrit_merge_triggers}'
356           projects:
357             - project-compare-type: ANT
358               project-pattern: '{project}'
359               branches:
360                 - branch-compare-type: ANT
361                   branch-pattern: '**/{branch}'
362               file-paths: '{obj:gerrit_trigger_file_paths}'
363
364 - job-template:
365     name: '{project-name}-jenkins-cfg-merge'
366     id: github-jenkins-cfg-merge
367     <<: *lf_jenkins_cfg_merge
368
369     properties:
370       - lf-infra-properties:
371           project: '{project}'
372           build-days-to-keep: 1
373       - github:
374           url: '{github-url}/{github-org}/{project}'
375
376     scm:
377       - lf-infra-github-scm:
378           url: '{git-clone-url}{github-org}/{project}'
379           refspec: ''
380           branch: 'refs/heads/{branch}'
381           submodule-recursive: true
382           submodule-timeout: '{submodule-timeout}'
383           submodule-disable: '{submodule-disable}'
384           choosing-strategy: default
385           jenkins-ssh-credential: '{jenkins-ssh-credential}'
386
387     triggers:
388       - timed: '{obj:cron}'
389       - github
390       - pollscm:
391           cron: ''
392       - github-pull-request:
393           trigger-phrase: '^remerge$'
394           only-trigger-phrase: true
395           status-context: 'Jenkins CFG Merge'
396           permit-all: true
397           github-hooks: true
398           org-list:
399             - '{github-org}'
400           white-list: '{obj:github_pr_whitelist}'
401           admin-list: '{obj:github_pr_admin_list}'
402           included-regions: '{obj:github_included_regions}'
403           white-list-target-branches:
404             - '{branch}'
405
406 ###########################################
407 # Jenkins Configuration Management Verify #
408 ###########################################
409
410 - lf_jenkins_configuration: &lf_jenkins_cfg_verify
411     name: lf-jenkins-cfg-verify
412
413     ######################
414     # Default parameters #
415     ######################
416
417     branch: master
418     build-days-to-keep: 7
419     disable-job: false
420     git-url: '$GIT_URL/$GERRIT_PROJECT'
421     github-url: 'https://github.com'
422     openstack-cloud: vex
423     submodule-timeout: 10
424     submodule-disable: false
425
426     gerrit_verify_triggers:
427       - patchset-created-event:
428           exclude-drafts: true
429           exclude-trivial-rebase: false
430           exclude-no-code-change: false
431       - draft-published-event
432       - comment-added-contains-event:
433           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
434
435     gerrit_trigger_file_paths:
436       - compare-type: REG_EXP
437         pattern: 'jenkins-config\/.*'
438
439     # github_included_regions MUST match gerrit_trigger_file_paths
440     github_included_regions:
441       - 'jenkins-config\/.*'
442
443     #####################
444     # Job Configuration #
445     #####################
446
447     project-type: freestyle
448     node: '{build-node}'
449     concurrent: true
450     disabled: '{disable-job}'
451
452     properties:
453       - lf-infra-properties:
454           project: '{project}'
455           build-days-to-keep: 1
456
457     parameters:
458       - lf-infra-parameters:
459           project: '{project}'
460           stream: ''
461           branch: master
462
463     wrappers:
464       - lf-infra-wrappers:
465           build-timeout: 10
466           jenkins-ssh-credential: '{jenkins-ssh-credential}'
467       - config-file-provider:
468           # Listed after to override openstack-infra-wrappers clouds.yaml
469           # definition
470           files:
471             - file-id: clouds-yaml
472               target: '$HOME/.config/openstack/clouds.yaml'
473             - file-id: npmrc
474               target: '$HOME/.npmrc'
475             - file-id: pipconf
476               target: '$HOME/.config/pip/pip.conf'
477
478     builders:
479       - lf-infra-pre-build
480       - inject:
481           properties-content: OS_CLOUD={openstack-cloud}
482       - shell: !include-raw-escape: ../shell/jenkins-verify-images.sh
483
484     publishers:
485       - lf-infra-publish
486
487 - job-template:
488     name: '{project-name}-jenkins-cfg-verify'
489     id: gerrit-jenkins-cfg-verify
490     <<: *lf_jenkins_cfg_verify
491
492     scm:
493       - lf-infra-gerrit-scm:
494           git-url: '{git-url}'
495           refspec: '$GERRIT_REFSPEC'
496           branch: '$GERRIT_BRANCH'
497           submodule-recursive: true
498           submodule-timeout: '{submodule-timeout}'
499           submodule-disable: '{submodule-disable}'
500           choosing-strategy: gerrit
501           jenkins-ssh-credential: '{jenkins-ssh-credential}'
502
503     triggers:
504       - gerrit:
505           server-name: '{gerrit-server-name}'
506           trigger-on: '{obj:gerrit_verify_triggers}'
507           projects:
508             - project-compare-type: ANT
509               project-pattern: '{project}'
510               branches:
511                 - branch-compare-type: ANT
512                   branch-pattern: '**/{branch}'
513               file-paths: '{obj:gerrit_trigger_file_paths}'
514
515 - job-template:
516     name: '{project-name}-jenkins-cfg-verify'
517     id: github-jenkins-cfg-verify
518     <<: *lf_jenkins_cfg_verify
519
520     properties:
521       - github:
522           url: '{github-url}/{github-org}/{project}'
523
524     scm:
525       - lf-infra-github-scm:
526           url: '{git-clone-url}{github-org}/{project}'
527           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
528           branch: '$sha1'
529           submodule-recursive: true
530           submodule-timeout: '{submodule-timeout}'
531           submodule-disable: '{submodule-disable}'
532           choosing-strategy: default
533           jenkins-ssh-credential: '{jenkins-ssh-credential}'
534
535     triggers:
536       - github-pull-request:
537           trigger-phrase: '^(recheck|reverify)$'
538           only-trigger-phrase: false
539           status-context: 'Jenkins CFG Verify'
540           permit-all: true
541           github-hooks: true
542           included-regions: '{obj:github_included_regions}'
543           white-list-target-branches:
544             - '{branch}'
545
546 ###########################
547 # JENKINS SANDBOX CLEANUP #
548 ###########################
549
550 - lf_jenkins_sandbox_cleanup: &lf_jenkins_sandbox_cleanup
551     name: lf-jenkins-sandbox-cleanup
552
553     ######################
554     # Default parameters #
555     ######################
556
557     build-timeout: 30
558     # Run every Saturday at 08:00 UTC
559     cron: '0 8 * * 6'
560     disable-job: false
561
562     #####################
563     # Job Configuration #
564     #####################
565
566     project-type: freestyle
567     node: '{build-node}'
568     concurrent: true
569     disabled: '{disable-job}'
570
571     parameters:
572       - lf-infra-jjb-parameters:
573           jjb-cache: '{jjb-cache}'
574           jjb-version: '{jjb-version}'
575
576     triggers:
577       - timed: '{obj:cron}'
578
579     builders:
580       - lf-infra-jjbini
581       - shell: !include-raw-escape:
582           - ../shell/jjb-install.sh
583           - ../shell/jenkins-sandbox-cleanup.sh
584           - ../shell/jjb-cleanup.sh
585
586 - job-template:
587     name: '{project-name}-jenkins-sandbox-cleanup'
588     id: gerrit-jenkins-sandbox-cleanup
589     <<: *lf_jjb_common
590     # yamllint disable-line rule:key-duplicates
591     <<: *lf_jenkins_sandbox_cleanup
592
593 - job-template:
594     name: '{project-name}-jenkins-sandbox-cleanup'
595     id: github-jenkins-sandbox-cleanup
596     <<: *lf_jjb_common
597     # yamllint disable-line rule:key-duplicates
598     <<: *lf_jenkins_sandbox_cleanup
599
600
601 ##################
602 # JJB DEPLOY JOB #
603 ##################
604
605 - lf_jjb_deploy_job: &lf_jjb_deploy_job
606     name: lf-jjb-deploy-job
607
608     ######################
609     # Default parameters #
610     ######################
611
612     branch: master
613     disable-job: false
614     # jjb-deploy should always clone $PROJECT regardless of what
615     # $GERRIT_PROJECT triggered the job.
616     git-url: '$GIT_URL/$PROJECT'
617     github-url: 'https://github.com'
618     stream: master
619     submodule-timeout: 10
620     submodule-disable: false
621     gerrit_jjb_deploy_job_triggers:
622       - comment-added-contains-event:
623           comment-contains-value: '^Patch Set\s+\d+:\s+(jjb-deploy[:]* (?!\*+$).+$)'
624
625     #####################
626     # Job Configuration #
627     #####################
628
629     project-type: freestyle
630     node: '{build-node}'
631     concurrent: true
632     disabled: '{disable-job}'
633
634     properties:
635       - lf-infra-properties:
636           project: '{project}'
637           build-days-to-keep: 1
638
639     parameters:
640       - lf-infra-parameters:
641           project: '{project}'
642           stream: '{stream}'
643           branch: '{branch}'
644
645     wrappers:
646       - lf-infra-wrappers:
647           build-timeout: 5
648           jenkins-ssh-credential: '{jenkins-ssh-credential}'
649
650     builders:
651       - lf-pip-install:
652           pip-packages: jenkins-job-builder
653       - lf-infra-jjbini-sandbox
654       - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
655
656     publishers:
657       - lf-infra-publish
658
659 - job-template:
660     name: '{project-name}-jjb-deploy-job'
661     id: gerrit-jjb-deploy-job
662     <<: *lf_jjb_deploy_job
663
664     scm:
665       - lf-infra-gerrit-scm:
666           git-url: '{git-url}'
667           refspec: 'refs/heads/{branch}'
668           branch: '{branch}'
669           submodule-recursive: true
670           submodule-timeout: '{submodule-timeout}'
671           submodule-disable: '{submodule-disable}'
672           choosing-strategy: default
673           jenkins-ssh-credential: '{jenkins-ssh-credential}'
674
675     triggers:
676       - gerrit:
677           server-name: '{gerrit-server-name}'
678           trigger-on: '{obj:gerrit_jjb_deploy_job_triggers}'
679           projects:
680             - project-compare-type: ANT
681               project-pattern: '**'
682               branches:
683                 - branch-compare-type: ANT
684                   branch-pattern: '**'
685           skip-vote:
686             success: true
687             failed: true
688             unstable: true
689             notbuilt: true
690
691 - job-template:
692     name: '{project-name}-jjb-deploy-job'
693     id: github-jjb-deploy-job
694     <<: *lf_jjb_deploy_job
695
696     properties:
697       - lf-infra-properties:
698           project: '{project}'
699           build-days-to-keep: 1
700       - github:
701           url: '{github-url}/{github-org}/{project}'
702
703     scm:
704       - lf-infra-github-scm:
705           url: '{git-clone-url}{github-org}/{project}'
706           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
707           branch: '$sha1'
708           submodule-recursive: true
709           submodule-timeout: '{submodule-timeout}'
710           submodule-disable: '{submodule-disable}'
711           choosing-strategy: default
712           jenkins-ssh-credential: '{jenkins-ssh-credential}'
713
714     triggers:
715       - github-pull-request:
716           trigger-phrase: '^jjb-deploy (?!\*+$).+$'
717           only-trigger-phrase: true
718           status-context: 'JJB Deploy Job'
719           permit-all: true
720           github-hooks: true
721           white-list-target-branches:
722             - '{branch}'
723
724 #############
725 # JJB Merge #
726 #############
727
728 - lf_jjb_merge: &lf_jjb_merge
729     name: lf-jjb-merge
730
731     ######################
732     # Default parameters #
733     ######################
734
735     jjb-workers: 0
736
737     gerrit_merge_triggers:
738       - change-merged-event
739       - comment-added-contains-event:
740           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
741
742     #####################
743     # Job Configuration #
744     #####################
745
746     builders:
747       - lf-infra-pre-build
748       - lf-infra-jjbini
749       - inject:
750           properties-content: JJB_WORKERS={jjb-workers}
751       - shell: !include-raw-escape:
752           - ../shell/jjb-install.sh
753           - ../shell/jjb-merge-job.sh
754           - ../shell/jjb-cleanup.sh
755
756 - job-template:
757     name: '{project-name}-jjb-merge'
758     id: gerrit-jjb-merge
759     <<: *lf_jjb_common
760     # yamllint disable-line rule:key-duplicates
761     <<: *lf_jjb_merge
762
763     git-url: '$GIT_URL/$GERRIT_PROJECT'
764
765     scm:
766       - lf-infra-gerrit-scm:
767           git-url: '{git-url}'
768           refspec: ''
769           branch: '{branch}'
770           submodule-recursive: '{submodule-recursive}'
771           submodule-timeout: '{submodule-timeout}'
772           submodule-disable: '{submodule-disable}'
773           choosing-strategy: default
774           jenkins-ssh-credential: '{jenkins-ssh-credential}'
775
776     triggers:
777       - gerrit:
778           server-name: '{gerrit-server-name}'
779           trigger-on: '{obj:gerrit_merge_triggers}'
780           projects:
781             - project-compare-type: ANT
782               project-pattern: '{project}'
783               branches:
784                 - branch-compare-type: ANT
785                   branch-pattern: '**/{branch}'
786               file-paths: '{obj:gerrit_trigger_file_paths}'
787
788 - job-template:
789     name: '{project-name}-jjb-merge'
790     id: github-jjb-merge
791     <<: *lf_jjb_common
792     # yamllint disable-line rule:key-duplicates
793     <<: *lf_jjb_merge
794
795     #####################
796     # Job Configuration #
797     #####################
798
799     properties:
800       - lf-infra-properties:
801           project: '{project}'
802           build-days-to-keep: 7
803       - github:
804           url: '{github-url}/{github-org}/{project}'
805
806     scm:
807       - lf-infra-github-scm:
808           url: '{git-clone-url}{github-org}/{project}'
809           refspec: ''
810           branch: 'refs/heads/{branch}'
811           submodule-recursive: '{submodule-recursive}'
812           submodule-timeout: '{submodule-timeout}'
813           submodule-disable: '{submodule-disable}'
814           choosing-strategy: default
815           jenkins-ssh-credential: '{jenkins-ssh-credential}'
816
817     triggers:
818       - github
819       - pollscm:
820           cron: ''
821       - github-pull-request:
822           trigger-phrase: '^remerge$'
823           only-trigger-phrase: true
824           status-context: 'JJB Merge'
825           permit-all: true
826           github-hooks: true
827           org-list:
828             - '{github-org}'
829           white-list: '{obj:github_pr_whitelist}'
830           admin-list: '{obj:github_pr_admin_list}'
831           included-regions: '{obj:github_included_regions}'
832           white-list-target-branches:
833             - '{branch}'
834
835 ##############
836 # JJB Verify #
837 ##############
838
839 - lf_jjb_verify: &lf_jjb_verify
840     name: lf-jjb-verify
841
842     ######################
843     # Default parameters #
844     ######################
845
846     build-concurrent: true
847
848     gerrit_verify_triggers:
849       - patchset-created-event:
850           exclude-drafts: true
851           exclude-trivial-rebase: false
852           exclude-no-code-change: false
853       - draft-published-event
854       - comment-added-contains-event:
855           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
856
857     #####################
858     # Job Configuration #
859     #####################
860
861     concurrent: '{build-concurrent}'
862
863     builders:
864       - lf-infra-pre-build
865       - lf-infra-jjbini
866       - shell: !include-raw-escape:
867           - ../shell/git-validate-jira-urls.sh
868           - ../shell/jjb-install.sh
869           - ../shell/jjb-verify-job.sh
870           - ../shell/jjb-check-unicode.sh
871           - ../shell/jjb-cleanup.sh
872       - lf-infra-gpg-verify-git-signature
873
874 - job-template:
875     name: '{project-name}-jjb-verify'
876     id: gerrit-jjb-verify
877     <<: *lf_jjb_common
878     # yamllint disable-line rule:key-duplicates
879     <<: *lf_jjb_verify
880
881     ######################
882     # Default parameters #
883     ######################
884
885     git-url: '$GIT_URL/$GERRIT_PROJECT'
886
887     #####################
888     # Job Configuration #
889     #####################
890
891     scm:
892       - lf-infra-gerrit-scm:
893           git-url: '{git-url}'
894           refspec: '$GERRIT_REFSPEC'
895           branch: '$GERRIT_BRANCH'
896           submodule-recursive: '{submodule-recursive}'
897           submodule-timeout: '{submodule-timeout}'
898           submodule-disable: '{submodule-disable}'
899           choosing-strategy: gerrit
900           jenkins-ssh-credential: '{jenkins-ssh-credential}'
901
902     triggers:
903       - gerrit:
904           server-name: '{gerrit-server-name}'
905           trigger-on: '{obj:gerrit_verify_triggers}'
906           projects:
907             - project-compare-type: ANT
908               project-pattern: '{project}'
909               branches:
910                 - branch-compare-type: ANT
911                   branch-pattern: '**/{branch}'
912               file-paths: '{obj:gerrit_trigger_file_paths}'
913
914 - job-template:
915     name: '{project-name}-jjb-verify'
916     id: github-jjb-verify
917     <<: *lf_jjb_common
918     # yamllint disable-line rule:key-duplicates
919     <<: *lf_jjb_verify
920
921     #####################
922     # Job Configuration #
923     #####################
924
925     properties:
926       - lf-infra-properties:
927           project: '{project}'
928           build-days-to-keep: 7
929       - github:
930           url: '{github-url}/{github-org}/{project}'
931
932     scm:
933       - lf-infra-github-scm:
934           url: '{git-clone-url}{github-org}/{project}'
935           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
936           branch: '$sha1'
937           submodule-recursive: '{submodule-recursive}'
938           submodule-timeout: '{submodule-timeout}'
939           submodule-disable: '{submodule-disable}'
940           choosing-strategy: default
941           jenkins-ssh-credential: '{jenkins-ssh-credential}'
942
943     triggers:
944       - github-pull-request:
945           trigger-phrase: '^(recheck|reverify)$'
946           only-trigger-phrase: false
947           status-context: 'JJB Verify'
948           permit-all: true
949           github-hooks: true
950           included-regions: '{obj:github_included_regions}'
951           white-list-target-branches:
952             - '{branch}'
953
954 ############################
955 # JJB Verify Upstream GJJB #
956 ############################
957
958 - lf_jjb_verify: &lf_jjb_verify_upstream_gjjb
959     name: lf-jjb-verify-upstream-gjjb
960
961     #####################
962     # Job Configuration #
963     #####################
964
965     concurrent: true
966
967     builders:
968       - shell: |
969           cd global-jjb
970           git fetch https://gerrit.linuxfoundation.org/infra/releng/global-jjb $GERRIT_REFSPEC
971           git cherry-pick FETCH_HEAD
972       - lf-infra-jjbini
973       - shell: !include-raw-escape:
974           - ../shell/git-validate-jira-urls.sh
975           - ../shell/jjb-install.sh
976           - ../shell/jjb-verify-job.sh
977           - ../shell/jjb-check-unicode.sh
978           - ../shell/jjb-cleanup.sh
979       - lf-infra-gpg-verify-git-signature
980
981 - job-template:
982     name: '{project-name}-jjb-verify-upstream-gjjb'
983     id: gerrit-jjb-verify-upstream-gjjb
984     <<: *lf_jjb_common
985     # yamllint disable-line rule:key-duplicates
986     <<: *lf_jjb_verify_upstream_gjjb
987
988     ######################
989     # Default parameters #
990     ######################
991
992     git-url: '$GIT_URL/$PROJECT'
993     submodule-timeout: 10
994     submodule-disable: false
995
996     #####################
997     # Job Configuration #
998     #####################
999
1000     scm:
1001       - lf-infra-gerrit-scm:
1002           git-url: '{git-url}'
1003           refspec: ''
1004           branch: 'master'
1005           submodule-recursive: true
1006           submodule-timeout: '{submodule-timeout}'
1007           submodule-disable: '{submodule-disable}'
1008           choosing-strategy: default
1009           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1010
1011     triggers:
1012       - gerrit:
1013           server-name: 'LinuxFoundation'
1014           trigger-on:
1015             - patchset-created-event:
1016                 exclude-drafts: true
1017                 exclude-trivial-rebase: false
1018                 exclude-no-code-change: false
1019             - draft-published-event
1020             - comment-added-contains-event:
1021                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1022           projects:
1023             - project-compare-type: ANT
1024               project-pattern: 'releng/global-jjb'
1025               branches:
1026                 - branch-compare-type: ANT
1027                   branch-pattern: '**/master'
1028           override-votes: true
1029           gerrit-build-failed-codereview-value: -1
1030           gerrit-build-failed-verified-value: 0
1031           gerrit-build-successful-codereview-value: 1
1032           gerrit-build-successful-verified-value: 0
1033
1034 #################
1035 # License Check #
1036 #################
1037
1038 - lf_license_check: &lf_license_check
1039     name: lf-license-check
1040
1041     ######################
1042     # Default parameters #
1043     ######################
1044
1045     branch: master
1046     build-days-to-keep: 7
1047     build-timeout: 15
1048     disable-job: false
1049     file-patterns: >
1050         *.go
1051         *.groovy
1052         *.java
1053         *.py
1054         *.sh
1055     git-url: '$GIT_URL/$PROJECT'
1056     github-url: 'https://github.com'
1057     lhc-version: 0.2.0
1058     license-exclude-paths: ''
1059     licenses-allowed: Apache-2.0,EPL-1.0,MIT
1060     project-pattern: '**'
1061     spdx-disable: false
1062     stream: master
1063     submodule-timeout: 10
1064     submodule-disable: false
1065
1066     #####################
1067     # Job Configuration #
1068     #####################
1069
1070     project-type: freestyle
1071     node: '{build-node}'
1072     concurrent: true
1073     disabled: '{disable-job}'
1074
1075     properties:
1076       - lf-infra-properties:
1077           build-days-to-keep: '{build-days-to-keep}'
1078
1079     parameters:
1080       - lf-infra-parameters:
1081           project: '{project}'
1082           branch: '{branch}'
1083           stream: '{stream}'
1084
1085     wrappers:
1086       - lf-infra-wrappers:
1087           build-timeout: '{build-timeout}'
1088           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1089
1090     builders:
1091       - lf-license-check:
1092           file-patterns: '{file-patterns}'
1093           spdx-disable: '{spdx-disable}'
1094           lhc-version: '{lhc-version}'
1095           license-exclude-paths: '{license-exclude-paths}'
1096           licenses-allowed: '{licenses-allowed}'
1097
1098     publishers:
1099       - lf-infra-publish
1100
1101 - job-template:
1102     name: '{project-name}-license-check'
1103     id: gerrit-license-check
1104     <<: *lf_license_check
1105
1106     git-url: '$GIT_URL/$GERRIT_PROJECT'
1107
1108     scm:
1109       - lf-infra-gerrit-scm:
1110           git-url: '{git-url}'
1111           refspec: '$GERRIT_REFSPEC'
1112           branch: '$GERRIT_BRANCH'
1113           # Submodules are out of the project's control
1114           submodule-recursive: false
1115           submodule-timeout: '{submodule-timeout}'
1116           submodule-disable: '{submodule-disable}'
1117           choosing-strategy: gerrit
1118           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1119
1120     triggers:
1121       - gerrit:
1122           server-name: '{gerrit-server-name}'
1123           # Trigger should not be overridable as we want to always run
1124           trigger-on:
1125             - patchset-created-event:
1126                 exclude-drafts: false
1127                 exclude-trivial-rebase: false
1128                 exclude-no-code-change: false
1129             - draft-published-event
1130             - comment-added-contains-event:
1131                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1132           projects:
1133             - project-compare-type: ANT
1134               project-pattern: '{project-pattern}'
1135               branches:
1136                 - branch-compare-type: ANT
1137                   branch-pattern: '**'
1138
1139 - job-template:
1140     name: '{project-name}-license-check'
1141     id: github-license-check
1142     <<: *lf_license_check
1143
1144     properties:
1145       - lf-infra-properties:
1146           build-days-to-keep: '{build-days-to-keep}'
1147       - github:
1148           url: '{github-url}/{github-org}/{project}'
1149
1150     scm:
1151       - lf-infra-github-scm:
1152           url: '{git-clone-url}{github-org}/{project}'
1153           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1154           branch: '$sha1'
1155           # Submodules are out of the project's control
1156           submodule-recursive: false
1157           submodule-timeout: '{submodule-timeout}'
1158           submodule-disable: '{submodule-disable}'
1159           choosing-strategy: default
1160           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1161
1162     triggers:
1163       - github-pull-request:
1164           trigger-phrase: '^recheck$'
1165           only-trigger-phrase: false
1166           status-context: 'License Check'
1167           permit-all: true
1168           github-hooks: true
1169           white-list-target-branches:
1170             - '{branch}'
1171
1172 ####################
1173 # Info YAML Verify #
1174 ####################
1175
1176 - lf_info_yaml_verify: &lf_info_yaml_verify
1177     name: lf-info-yaml-verify
1178
1179     ######################
1180     # Default parameters #
1181     ######################
1182
1183     gerrit_verify_triggers:
1184       - patchset-created-event:
1185           exclude-drafts: true
1186           exclude-trivial-rebase: false
1187           exclude-no-code-change: false
1188       - draft-published-event
1189       - comment-added-contains-event:
1190           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1191
1192     #####################
1193     # Job Configuration #
1194     #####################
1195
1196     concurrent: true
1197
1198     builders:
1199       - shell: !include-raw-escape:
1200           - ../shell/git-validate-info-yaml.sh
1201           - ../shell/info-file-validate.sh
1202
1203 - job-template:
1204     name: '{project-name}-info-yaml-verify'
1205     id: gerrit-info-yaml-verify
1206     <<: *lf_jjb_common
1207     # yamllint disable-line rule:key-duplicates
1208     <<: *lf_info_yaml_verify
1209
1210     git-url: '$GIT_URL/$GERRIT_PROJECT'
1211
1212     scm:
1213       - lf-infra-gerrit-scm:
1214           git-url: '{git-url}'
1215           refspec: '$GERRIT_REFSPEC'
1216           branch: '$GERRIT_BRANCH'
1217           submodule-recursive: '{submodule-recursive}'
1218           submodule-timeout: '{submodule-timeout}'
1219           submodule-disable: '{submodule-disable}'
1220           choosing-strategy: gerrit
1221           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1222
1223     triggers:
1224       - gerrit:
1225           server-name: '{gerrit-server-name}'
1226           trigger-on: '{obj:gerrit_verify_triggers}'
1227           projects:
1228             - project-compare-type: ANT
1229               project-pattern: '{project}'
1230               branches:
1231                 - branch-compare-type: ANT
1232                   branch-pattern: '**/{branch}'
1233               file-paths:
1234                 - compare-type: REG_EXP
1235                   pattern: 'INFO.yaml'
1236
1237 - job-template:
1238     name: '{project-name}-info-yaml-verify'
1239     id: github-info-yaml-verify
1240     <<: *lf_jjb_common
1241     # yamllint disable-line rule:key-duplicates
1242     <<: *lf_info_yaml_verify
1243
1244     github-url: 'https://github.com'
1245     properties:
1246       - github:
1247           url: '{github-url}/{github-org}/{project}'
1248
1249     scm:
1250       - lf-infra-github-scm:
1251           url: '{git-clone-url}{github-org}/{project}'
1252           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1253           branch: '$sha1'
1254           submodule-recursive: '{submodule-recursive}'
1255           submodule-timeout: '{submodule-timeout}'
1256           submodule-disable: '{submodule-disable}'
1257           choosing-strategy: default
1258           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1259
1260     triggers:
1261       - github-pull-request:
1262           trigger-phrase: '^(recheck|reverify)$'
1263           only-trigger-phrase: false
1264           status-context: 'INFO File Verify'
1265           permit-all: true
1266           github-hooks: true
1267           # included-regions MUST match gerrit file-paths
1268           included-regions: 'INFO.yaml'
1269           white-list-target-branches:
1270             - '{branch}'
1271
1272 ##################
1273 # OPENSTACK CRON #
1274 ##################
1275
1276 - lf_openstack_cron: &lf_openstack_cron
1277     name: lf-openstack-cron
1278
1279     ######################
1280     # Default parameters #
1281     ######################
1282
1283     branch: master
1284     build-days-to-keep: 7
1285     build-timeout: 10
1286     cron: '@hourly'
1287     disable-job: false
1288     git-url: '$GIT_URL/$PROJECT'
1289     github-url: 'https://github.com'
1290     openstack-cloud: vex
1291     openstack-image-cleanup: true
1292     openstack-image-cleanup-age: 30
1293     openstack-image-protect: true
1294     openstack-server-cleanup: true
1295     openstack-stack-cleanup: true
1296     openstack-volume-cleanup: true
1297     stream: master
1298     submodule-timeout: 10
1299     submodule-disable: false
1300
1301     #####################
1302     # Job Configuration #
1303     #####################
1304
1305     project-type: freestyle
1306     node: '{build-node}'
1307     concurrent: false
1308     disabled: '{disable-job}'
1309
1310     properties:
1311       - lf-infra-properties:
1312           build-days-to-keep: '{build-days-to-keep}'
1313
1314     parameters:
1315       - lf-infra-parameters:
1316           project: '{project}'
1317           stream: '{stream}'
1318           branch: '{branch}'
1319       - string:
1320           name: JENKINS_URLS
1321           default: '{jenkins-urls}'
1322           description: |
1323               Space separated list of Jenkins URLs to check for active builds.
1324
1325     wrappers:
1326       - lf-infra-wrappers:
1327           build-timeout: '{build-timeout}'
1328           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1329       # Listed after to override openstack-infra-wrappers clouds.yaml definition
1330       - config-file-provider:
1331           files:
1332             - file-id: clouds-yaml
1333               target: '$HOME/.config/openstack/clouds.yaml'
1334             - file-id: npmrc
1335               target: '$HOME/.npmrc'
1336             - file-id: pipconf
1337               target: '$HOME/.config/pip/pip.conf'
1338
1339     triggers:
1340       - timed: '{obj:cron}'
1341
1342     builders:
1343       - lf-infra-pre-build
1344       - inject:
1345           properties-content: OS_CLOUD={openstack-cloud}
1346       # Stacks
1347       - conditional-step:
1348           condition-kind: boolean-expression
1349           condition-expression: '{openstack-stack-cleanup}'
1350           steps:
1351             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-stacks.sh
1352       # Servers
1353       - conditional-step:
1354           condition-kind: boolean-expression
1355           condition-expression: '{openstack-server-cleanup}'
1356           steps:
1357             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-servers.sh
1358       # Volumes
1359       - conditional-step:
1360           condition-kind: boolean-expression
1361           condition-expression: '{openstack-volume-cleanup}'
1362           steps:
1363             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-volumes.sh
1364       # Images
1365       - conditional-step:
1366           condition-kind: boolean-expression
1367           condition-expression: '{openstack-image-protect}'
1368           steps:
1369             - shell: !include-raw-escape: ../shell/openstack-protect-in-use-images.sh
1370       - conditional-step:
1371           condition-kind: boolean-expression
1372           condition-expression: '{openstack-image-cleanup}'
1373           steps:
1374             - inject:
1375                 properties-content: OS_IMAGE_CLEANUP_AGE={openstack-image-cleanup-age}
1376             - shell: !include-raw-escape: ../shell/openstack-cleanup-old-images.sh
1377
1378     publishers:
1379       - lf-infra-publish
1380
1381 - job-template:
1382     name: '{project-name}-openstack-cron'
1383     id: gerrit-openstack-cron
1384     <<: *lf_openstack_cron
1385
1386     scm:
1387       - lf-infra-gerrit-scm:
1388           git-url: '{git-url}'
1389           refspec: 'refs/heads/{branch}'
1390           branch: '{branch}'
1391           submodule-recursive: true
1392           submodule-timeout: '{submodule-timeout}'
1393           submodule-disable: '{submodule-disable}'
1394           choosing-strategy: default
1395           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1396
1397 - job-template:
1398     name: '{project-name}-openstack-cron'
1399     id: github-openstack-cron
1400     <<: *lf_openstack_cron
1401
1402     scm:
1403       - lf-infra-github-scm:
1404           url: '{git-clone-url}{github-org}/{project}'
1405           refspec: ''
1406           branch: 'refs/heads/{branch}'
1407           submodule-recursive: true
1408           submodule-timeout: '{submodule-timeout}'
1409           submodule-disable: '{submodule-disable}'
1410           choosing-strategy: default
1411           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1412
1413 ################
1414 # Packer Merge #
1415 ################
1416
1417 - lf_packer_merge: &lf_packer_merge
1418     name: lf-packer-merge
1419
1420     ######################
1421     # Default parameters #
1422     ######################
1423
1424     openstack: true
1425     openstack-cloud: vex
1426
1427     #####################
1428     # Job Configuration #
1429     #####################
1430
1431     parameters:
1432       - lf-infra-parameters:
1433           project: '{project}'
1434           stream: '{stream}'
1435           branch: '{branch}'
1436       - lf-packer-parameters:
1437           packer-version: '{packer-version}'
1438
1439     builders:
1440       - lf-infra-packer-build:
1441           openstack: '{openstack}'
1442           openstack-cloud: '{openstack-cloud}'
1443           packer-cloud-settings: '{packer-cloud-settings}'
1444           packer-version: '{packer-version}'
1445           platform: '{platforms}'
1446           template: '{templates}'
1447       - description-setter:
1448           description: '.*Creating the image:(.*)'
1449
1450 - job-template:
1451     name: '{project-name}-packer-merge-{platforms}-{templates}'
1452     id: gerrit-packer-merge
1453     <<: *lf_packer_common
1454     # yamllint disable-line rule:key-duplicates
1455     <<: *lf_packer_merge
1456
1457     ######################
1458     # Default parameters #
1459     ######################
1460
1461     git-url: '$GIT_URL/$GERRIT_PROJECT'
1462
1463     gerrit_merge_triggers:
1464       - change-merged-event
1465       - comment-added-contains-event:
1466           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
1467
1468     #####################
1469     # Job Configuration #
1470     #####################
1471
1472     scm:
1473       - lf-infra-gerrit-scm:
1474           git-url: '{git-url}'
1475           refspec: '$GERRIT_REFSPEC'
1476           branch: '$GERRIT_BRANCH'
1477           submodule-recursive: '{submodule-recursive}'
1478           submodule-timeout: '{submodule-timeout}'
1479           submodule-disable: '{submodule-disable}'
1480           choosing-strategy: default
1481           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1482
1483     triggers:
1484       - timed: '{obj:cron}'
1485       - gerrit:
1486           server-name: '{gerrit-server-name}'
1487           trigger-on: '{obj:gerrit_merge_triggers}'
1488           projects:
1489             - project-compare-type: ANT
1490               project-pattern: '{project}'
1491               branches:
1492                 - branch-compare-type: ANT
1493                   branch-pattern: '**/{branch}'
1494               file-paths:
1495                 - compare-type: REG_EXP
1496                   pattern: 'packer\/provision\/.*\.sh'
1497                 - compare-type: REG_EXP
1498                   pattern: 'packer\/provision\/.*\.bat'
1499                 - compare-type: REG_EXP
1500                   pattern: 'packer\/provision\/.*\.ps1'
1501                 - compare-type: REG_EXP
1502                   pattern: 'packer\/provision\/{templates}\.yaml'
1503                 - compare-type: REG_EXP
1504                   pattern: 'packer\/provision\/local-{templates}\.yaml'
1505                 - compare-type: REG_EXP
1506                   pattern: 'packer\/templates\/{templates}\.json'
1507                 - compare-type: REG_EXP
1508                   pattern: 'packer\/vars\/{platforms}\.json'
1509
1510 - job-template:
1511     name: '{project-name}-packer-merge-{platforms}-{templates}'
1512     id: github-packer-merge
1513     <<: *lf_packer_common
1514     # yamllint disable-line rule:key-duplicates
1515     <<: *lf_packer_merge
1516
1517     #####################
1518     # Job Configuration #
1519     #####################
1520
1521     properties:
1522       - lf-infra-properties:
1523           project: '{project}'
1524           build-days-to-keep: 7
1525       - github:
1526           url: '{github-url}/{github-org}/{project}'
1527
1528     scm:
1529       - lf-infra-github-scm:
1530           url: '{git-clone-url}{github-org}/{project}'
1531           refspec: >
1532               +refs/heads/*:refs/remotes/origin/*
1533               +refs/pull/*:refs/remotes/origin/pr/*
1534           branch: '$GERRIT_REFSPEC'
1535           submodule-recursive: '{submodule-recursive}'
1536           submodule-timeout: '{submodule-timeout}'
1537           submodule-disable: '{submodule-disable}'
1538           choosing-strategy: default
1539           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1540
1541     triggers:
1542       - timed: '{obj:cron}'
1543       - github
1544       - pollscm:
1545           cron: ''
1546
1547       - github-pull-request:
1548           trigger-phrase: '^remerge$'
1549           only-trigger-phrase: true
1550           status-context: 'Packer {platforms}-{templates} Merge'
1551           permit-all: true
1552           github-hooks: true
1553           org-list:
1554             - '{github-org}'
1555           white-list: '{obj:github_pr_whitelist}'
1556           admin-list: '{obj:github_pr_admin_list}'
1557           # included-regions MUST match Gerrit Trigger file-paths
1558           included-regions:
1559             - 'packer\/provision\/.*\.sh'
1560             - 'packer\/provision\/.*\.bat'
1561             - 'packer\/provision\/.*\.ps1'
1562             - 'packer\/provision\/{templates}\.yaml'
1563             - 'packer\/provision\/local-{templates}\.yaml'
1564             - 'packer\/templates\/{templates}\.json'
1565             - 'packer\/vars\/{platforms}\.json'
1566           white-list-target-branches:
1567             - '{branch}'
1568
1569 #################
1570 # Packer Verify #
1571 #################
1572
1573 - lf_packer_verify: &lf_packer_verify
1574     name: lf-packer-verify
1575
1576     ######################
1577     # Default parameters #
1578     ######################
1579
1580     build-timeout: 10
1581     openstack: true
1582     openstack-cloud: vex
1583
1584     gerrit_verify_triggers:
1585       - patchset-created-event:
1586           exclude-drafts: true
1587           exclude-trivial-rebase: false
1588           exclude-no-code-change: false
1589       - draft-published-event
1590       - comment-added-contains-event:
1591           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1592
1593     gerrit_trigger_file_paths:
1594       - compare-type: REG_EXP
1595         pattern: 'packer\/.*'
1596
1597     # github_included_regions MUST match gerrit_trigger_file_paths
1598     github_included_regions:
1599       - 'packer\/.*'
1600
1601     #####################
1602     # Job Configuration #
1603     #####################
1604
1605     concurrent: true
1606
1607     builders:
1608       - lf-infra-packer-validate:
1609           openstack: '{openstack}'
1610           openstack-cloud: '{openstack-cloud}'
1611           packer-cloud-settings: '{packer-cloud-settings}'
1612           packer-version: '{packer-version}'
1613
1614 - job-template:
1615     name: '{project-name}-packer-verify'
1616     id: gerrit-packer-verify
1617     <<: *lf_packer_common
1618     # yamllint disable-line rule:key-duplicates
1619     <<: *lf_packer_verify
1620
1621     ######################
1622     # Default parameters #
1623     ######################
1624
1625     git-url: '$GIT_URL/$GERRIT_PROJECT'
1626
1627     #####################
1628     # Job Configuration #
1629     #####################
1630
1631     scm:
1632       - lf-infra-gerrit-scm:
1633           git-url: '{git-url}'
1634           refspec: '$GERRIT_REFSPEC'
1635           branch: '$GERRIT_BRANCH'
1636           submodule-recursive: '{submodule-recursive}'
1637           submodule-timeout: '{submodule-timeout}'
1638           submodule-disable: '{submodule-disable}'
1639           choosing-strategy: gerrit
1640           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1641
1642     triggers:
1643       - gerrit:
1644           server-name: '{gerrit-server-name}'
1645           trigger-on: '{obj:gerrit_verify_triggers}'
1646           projects:
1647             - project-compare-type: ANT
1648               project-pattern: '{project}'
1649               branches:
1650                 - branch-compare-type: ANT
1651                   branch-pattern: '**/{branch}'
1652               file-paths: '{obj:gerrit_trigger_file_paths}'
1653
1654 - job-template:
1655     name: '{project-name}-packer-verify'
1656     id: github-packer-verify
1657     <<: *lf_packer_common
1658     # yamllint disable-line rule:key-duplicates
1659     <<: *lf_packer_verify
1660
1661     #####################
1662     # Job Configuration #
1663     #####################
1664
1665     properties:
1666       - lf-infra-properties:
1667           project: '{project}'
1668           build-days-to-keep: 7
1669       - github:
1670           url: '{github-url}/{github-org}/{project}'
1671
1672     scm:
1673       - lf-infra-github-scm:
1674           url: '{git-clone-url}{github-org}/{project}'
1675           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1676           branch: '$sha1'
1677           submodule-recursive: '{submodule-recursive}'
1678           submodule-timeout: '{submodule-timeout}'
1679           submodule-disable: '{submodule-disable}'
1680           choosing-strategy: default
1681           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1682
1683     triggers:
1684       - github-pull-request:
1685           trigger-phrase: '^(recheck|reverify)$'
1686           only-trigger-phrase: false
1687           status-context: 'Packer Verify'
1688           permit-all: true
1689           github-hooks: true
1690           included-regions: '{obj:github_included_regions}'
1691           white-list-target-branches:
1692             - '{branch}'
1693
1694 #################
1695 # Puppet Verify #
1696 #################
1697
1698 - lf_puppet_verify: &lf_puppet_verify
1699     name: lf-puppet-verify
1700
1701     ######################
1702     # Default parameters #
1703     ######################
1704
1705     branch: master
1706     build-days-to-keep: 7
1707     build-timeout: 15
1708     disable-job: false
1709     git-url: '$GIT_URL/$GERRIT_PROJECT'
1710     github-url: 'https://github.com'
1711     parallel: true
1712     puppet-dir: ''
1713     puppet-lint-version: 2.3.6
1714     stream: master
1715     submodule-recursive: true
1716     submodule-timeout: 10
1717     submodule-disable: false
1718
1719     gerrit_trigger_file_paths:
1720       - compare-type: REG_EXP
1721         pattern: '.*'
1722
1723     # github_included_regions MUST match gerrit_trigger_file_paths
1724     github_included_regions:
1725       - '.*'
1726
1727     #####################
1728     # Job Configuration #
1729     #####################
1730
1731     project-type: freestyle
1732     node: '{build-node}'
1733     concurrent: true
1734     disabled: '{disable-job}'
1735
1736     properties:
1737       - lf-infra-properties:
1738           build-days-to-keep: '{build-days-to-keep}'
1739
1740     parameters:
1741       - lf-infra-parameters:
1742           project: '{project}'
1743           branch: '{branch}'
1744           stream: '{stream}'
1745       - lf-puppet-parameters:
1746           puppet-lint-version: '{puppet-lint-version}'
1747
1748     wrappers:
1749       - lf-infra-wrappers:
1750           build-timeout: '{build-timeout}'
1751           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1752
1753     builders:
1754       - shell: !include-raw-escape: ../shell/puppet-lint.sh
1755
1756     publishers:
1757       - lf-infra-publish
1758
1759 - job-template:
1760     name: '{project-name}-puppet-verify'
1761     id: gerrit-puppet-verify
1762     <<: *lf_puppet_verify
1763
1764     ######################
1765     # Default parameters #
1766     ######################
1767
1768     gerrit_verify_triggers:
1769       - patchset-created-event:
1770           exclude-drafts: true
1771           exclude-trivial-rebase: false
1772           exclude-no-code-change: false
1773       - draft-published-event
1774       - comment-added-contains-event:
1775           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1776
1777     #####################
1778     # Job Configuration #
1779     #####################
1780
1781     scm:
1782       - lf-infra-gerrit-scm:
1783           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1784           git-url: '{git-url}'
1785           refspec: '$GERRIT_REFSPEC'
1786           branch: '$GERRIT_BRANCH'
1787           submodule-recursive: '{submodule-recursive}'
1788           submodule-timeout: '{submodule-timeout}'
1789           submodule-disable: '{submodule-disable}'
1790           choosing-strategy: gerrit
1791
1792     triggers:
1793       - gerrit:
1794           server-name: '{gerrit-server-name}'
1795           trigger-on: '{obj:gerrit_verify_triggers}'
1796           projects:
1797             - project-compare-type: ANT
1798               project-pattern: '{project}'
1799               branches:
1800                 - branch-compare-type: ANT
1801                   branch-pattern: '**/{branch}'
1802               file-paths: '{obj:gerrit_trigger_file_paths}'
1803
1804 - job-template:
1805     name: '{project-name}-puppet-verify'
1806     id: github-puppet-verify
1807     <<: *lf_puppet_verify
1808
1809     #####################
1810     # Job Configuration #
1811     #####################
1812
1813     properties:
1814       - lf-infra-properties:
1815           project: '{project}'
1816           build-days-to-keep: 7
1817       - github:
1818           url: '{github-url}/{github-org}/{project}'
1819
1820     scm:
1821       - lf-infra-github-scm:
1822           url: '{git-clone-url}{github-org}/{project}'
1823           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1824           branch: '$sha1'
1825           submodule-recursive: '{submodule-recursive}'
1826           submodule-timeout: '{submodule-timeout}'
1827           submodule-disable: '{submodule-disable}'
1828           choosing-strategy: default
1829           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1830
1831     triggers:
1832       - github-pull-request:
1833           trigger-phrase: '^(recheck|reverify)$'
1834           only-trigger-phrase: false
1835           status-context: 'Puppet Verify'
1836           permit-all: true
1837           github-hooks: true
1838           included-regions: '{obj:github_included_regions}'
1839           white-list-target-branches:
1840             - '{branch}'