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