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