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