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