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