Fix formatting to prettier style
[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           description: ".*Creating the image:(.*)"
1453
1454 - job-template:
1455     name: "{project-name}-packer-merge-{platforms}-{templates}"
1456     id: gerrit-packer-merge
1457     <<: *lf_packer_common
1458     # yamllint disable-line rule:key-duplicates
1459     <<: *lf_packer_merge
1460
1461     ######################
1462     # Default parameters #
1463     ######################
1464
1465     git-url: "$GIT_URL/$GERRIT_PROJECT"
1466
1467     gerrit_merge_triggers:
1468       - change-merged-event
1469       - comment-added-contains-event:
1470           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
1471
1472     #####################
1473     # Job Configuration #
1474     #####################
1475
1476     scm:
1477       - lf-infra-gerrit-scm:
1478           git-url: "{git-url}"
1479           refspec: "$GERRIT_REFSPEC"
1480           branch: "$GERRIT_BRANCH"
1481           submodule-recursive: "{submodule-recursive}"
1482           submodule-timeout: "{submodule-timeout}"
1483           submodule-disable: "{submodule-disable}"
1484           choosing-strategy: default
1485           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1486
1487     triggers:
1488       - timed: "{obj:cron}"
1489       - gerrit:
1490           server-name: "{gerrit-server-name}"
1491           trigger-on: "{obj:gerrit_merge_triggers}"
1492           projects:
1493             - project-compare-type: ANT
1494               project-pattern: "{project}"
1495               branches:
1496                 - branch-compare-type: ANT
1497                   branch-pattern: "**/{branch}"
1498               file-paths:
1499                 - compare-type: REG_EXP
1500                   pattern: 'packer\/provision\/.*\.sh'
1501                 - compare-type: REG_EXP
1502                   pattern: 'packer\/provision\/.*\.bat'
1503                 - compare-type: REG_EXP
1504                   pattern: 'packer\/provision\/.*\.ps1'
1505                 - compare-type: REG_EXP
1506                   pattern: 'packer\/provision\/{templates}\.yaml'
1507                 - compare-type: REG_EXP
1508                   pattern: 'packer\/provision\/local-{templates}\.yaml'
1509                 - compare-type: REG_EXP
1510                   pattern: 'packer\/templates\/{templates}\.json'
1511                 - compare-type: REG_EXP
1512                   pattern: 'packer\/vars\/{platforms}\.json'
1513
1514 - job-template:
1515     name: "{project-name}-packer-merge-{platforms}-{templates}"
1516     id: github-packer-merge
1517     <<: *lf_packer_common
1518     # yamllint disable-line rule:key-duplicates
1519     <<: *lf_packer_merge
1520
1521     #####################
1522     # Job Configuration #
1523     #####################
1524
1525     properties:
1526       - lf-infra-properties:
1527           project: "{project}"
1528           build-days-to-keep: 7
1529       - github:
1530           url: "{github-url}/{github-org}/{project}"
1531
1532     scm:
1533       - lf-infra-github-scm:
1534           url: "{git-clone-url}{github-org}/{project}"
1535           refspec: >
1536             +refs/heads/*:refs/remotes/origin/*
1537             +refs/pull/*:refs/remotes/origin/pr/*
1538           branch: "$GERRIT_REFSPEC"
1539           submodule-recursive: "{submodule-recursive}"
1540           submodule-timeout: "{submodule-timeout}"
1541           submodule-disable: "{submodule-disable}"
1542           choosing-strategy: default
1543           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1544
1545     triggers:
1546       - timed: "{obj:cron}"
1547       - github
1548       - pollscm:
1549           cron: ""
1550
1551       - github-pull-request:
1552           trigger-phrase: "^remerge$"
1553           only-trigger-phrase: true
1554           status-context: "Packer {platforms}-{templates} Merge"
1555           permit-all: true
1556           github-hooks: true
1557           org-list:
1558             - "{github-org}"
1559           white-list: "{obj:github_pr_whitelist}"
1560           admin-list: "{obj:github_pr_admin_list}"
1561           # included-regions MUST match Gerrit Trigger file-paths
1562           included-regions:
1563             - 'packer\/provision\/.*\.sh'
1564             - 'packer\/provision\/.*\.bat'
1565             - 'packer\/provision\/.*\.ps1'
1566             - 'packer\/provision\/{templates}\.yaml'
1567             - 'packer\/provision\/local-{templates}\.yaml'
1568             - 'packer\/templates\/{templates}\.json'
1569             - 'packer\/vars\/{platforms}\.json'
1570           white-list-target-branches:
1571             - "{branch}"
1572
1573 #################
1574 # Packer Verify #
1575 #################
1576
1577 - lf_packer_verify: &lf_packer_verify
1578     name: lf-packer-verify
1579
1580     ######################
1581     # Default parameters #
1582     ######################
1583
1584     build-timeout: 10
1585     openstack: true
1586     openstack-cloud: vex
1587
1588     gerrit_verify_triggers:
1589       - patchset-created-event:
1590           exclude-drafts: true
1591           exclude-trivial-rebase: false
1592           exclude-no-code-change: false
1593       - draft-published-event
1594       - comment-added-contains-event:
1595           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1596
1597     gerrit_trigger_file_paths:
1598       - compare-type: REG_EXP
1599         pattern: 'packer\/.*'
1600
1601     # github_included_regions MUST match gerrit_trigger_file_paths
1602     github_included_regions:
1603       - 'packer\/.*'
1604
1605     #####################
1606     # Job Configuration #
1607     #####################
1608
1609     concurrent: true
1610
1611     builders:
1612       - lf-infra-packer-validate:
1613           openstack: "{openstack}"
1614           openstack-cloud: "{openstack-cloud}"
1615           packer-cloud-settings: "{packer-cloud-settings}"
1616           packer-version: "{packer-version}"
1617
1618 - job-template:
1619     name: "{project-name}-packer-verify"
1620     id: gerrit-packer-verify
1621     <<: *lf_packer_common
1622     # yamllint disable-line rule:key-duplicates
1623     <<: *lf_packer_verify
1624
1625     ######################
1626     # Default parameters #
1627     ######################
1628
1629     git-url: "$GIT_URL/$GERRIT_PROJECT"
1630
1631     #####################
1632     # Job Configuration #
1633     #####################
1634
1635     scm:
1636       - lf-infra-gerrit-scm:
1637           git-url: "{git-url}"
1638           refspec: "$GERRIT_REFSPEC"
1639           branch: "$GERRIT_BRANCH"
1640           submodule-recursive: "{submodule-recursive}"
1641           submodule-timeout: "{submodule-timeout}"
1642           submodule-disable: "{submodule-disable}"
1643           choosing-strategy: gerrit
1644           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1645
1646     triggers:
1647       - gerrit:
1648           server-name: "{gerrit-server-name}"
1649           trigger-on: "{obj:gerrit_verify_triggers}"
1650           projects:
1651             - project-compare-type: ANT
1652               project-pattern: "{project}"
1653               branches:
1654                 - branch-compare-type: ANT
1655                   branch-pattern: "**/{branch}"
1656               file-paths: "{obj:gerrit_trigger_file_paths}"
1657
1658 - job-template:
1659     name: "{project-name}-packer-verify"
1660     id: github-packer-verify
1661     <<: *lf_packer_common
1662     # yamllint disable-line rule:key-duplicates
1663     <<: *lf_packer_verify
1664
1665     #####################
1666     # Job Configuration #
1667     #####################
1668
1669     properties:
1670       - lf-infra-properties:
1671           project: "{project}"
1672           build-days-to-keep: 7
1673       - github:
1674           url: "{github-url}/{github-org}/{project}"
1675
1676     scm:
1677       - lf-infra-github-scm:
1678           url: "{git-clone-url}{github-org}/{project}"
1679           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1680           branch: "$sha1"
1681           submodule-recursive: "{submodule-recursive}"
1682           submodule-timeout: "{submodule-timeout}"
1683           submodule-disable: "{submodule-disable}"
1684           choosing-strategy: default
1685           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1686
1687     triggers:
1688       - github-pull-request:
1689           trigger-phrase: "^(recheck|reverify)$"
1690           only-trigger-phrase: false
1691           status-context: "Packer Verify"
1692           permit-all: true
1693           github-hooks: true
1694           included-regions: "{obj:github_included_regions}"
1695           white-list-target-branches:
1696             - "{branch}"
1697
1698 #################
1699 # Puppet Verify #
1700 #################
1701
1702 - lf_puppet_verify: &lf_puppet_verify
1703     name: lf-puppet-verify
1704
1705     ######################
1706     # Default parameters #
1707     ######################
1708
1709     branch: master
1710     build-days-to-keep: 7
1711     build-timeout: 15
1712     disable-job: false
1713     git-url: "$GIT_URL/$GERRIT_PROJECT"
1714     github-url: "https://github.com"
1715     parallel: true
1716     puppet-dir: ""
1717     puppet-lint-version: 2.3.6
1718     stream: master
1719     submodule-recursive: true
1720     submodule-timeout: 10
1721     submodule-disable: false
1722
1723     gerrit_trigger_file_paths:
1724       - compare-type: REG_EXP
1725         pattern: ".*"
1726
1727     # github_included_regions MUST match gerrit_trigger_file_paths
1728     github_included_regions:
1729       - ".*"
1730
1731     #####################
1732     # Job Configuration #
1733     #####################
1734
1735     project-type: freestyle
1736     node: "{build-node}"
1737     concurrent: true
1738     disabled: "{disable-job}"
1739
1740     properties:
1741       - lf-infra-properties:
1742           build-days-to-keep: "{build-days-to-keep}"
1743
1744     parameters:
1745       - lf-infra-parameters:
1746           project: "{project}"
1747           branch: "{branch}"
1748           stream: "{stream}"
1749       - lf-puppet-parameters:
1750           puppet-lint-version: "{puppet-lint-version}"
1751
1752     wrappers:
1753       - lf-infra-wrappers:
1754           build-timeout: "{build-timeout}"
1755           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1756
1757     builders:
1758       - shell: !include-raw-escape: ../shell/puppet-lint.sh
1759
1760     publishers:
1761       - lf-infra-publish
1762
1763 - job-template:
1764     name: "{project-name}-puppet-verify"
1765     id: gerrit-puppet-verify
1766     <<: *lf_puppet_verify
1767
1768     ######################
1769     # Default parameters #
1770     ######################
1771
1772     gerrit_verify_triggers:
1773       - patchset-created-event:
1774           exclude-drafts: true
1775           exclude-trivial-rebase: false
1776           exclude-no-code-change: false
1777       - draft-published-event
1778       - comment-added-contains-event:
1779           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1780
1781     #####################
1782     # Job Configuration #
1783     #####################
1784
1785     scm:
1786       - lf-infra-gerrit-scm:
1787           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1788           git-url: "{git-url}"
1789           refspec: "$GERRIT_REFSPEC"
1790           branch: "$GERRIT_BRANCH"
1791           submodule-recursive: "{submodule-recursive}"
1792           submodule-timeout: "{submodule-timeout}"
1793           submodule-disable: "{submodule-disable}"
1794           choosing-strategy: gerrit
1795
1796     triggers:
1797       - gerrit:
1798           server-name: "{gerrit-server-name}"
1799           trigger-on: "{obj:gerrit_verify_triggers}"
1800           projects:
1801             - project-compare-type: ANT
1802               project-pattern: "{project}"
1803               branches:
1804                 - branch-compare-type: ANT
1805                   branch-pattern: "**/{branch}"
1806               file-paths: "{obj:gerrit_trigger_file_paths}"
1807
1808 - job-template:
1809     name: "{project-name}-puppet-verify"
1810     id: github-puppet-verify
1811     <<: *lf_puppet_verify
1812
1813     #####################
1814     # Job Configuration #
1815     #####################
1816
1817     properties:
1818       - lf-infra-properties:
1819           project: "{project}"
1820           build-days-to-keep: 7
1821       - github:
1822           url: "{github-url}/{github-org}/{project}"
1823
1824     scm:
1825       - lf-infra-github-scm:
1826           url: "{git-clone-url}{github-org}/{project}"
1827           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1828           branch: "$sha1"
1829           submodule-recursive: "{submodule-recursive}"
1830           submodule-timeout: "{submodule-timeout}"
1831           submodule-disable: "{submodule-disable}"
1832           choosing-strategy: default
1833           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1834
1835     triggers:
1836       - github-pull-request:
1837           trigger-phrase: "^(recheck|reverify)$"
1838           only-trigger-phrase: false
1839           status-context: "Puppet Verify"
1840           permit-all: true
1841           github-hooks: true
1842           included-regions: "{obj:github_included_regions}"
1843           white-list-target-branches:
1844             - "{branch}"