Fix jjb-deploy job to accept JJB_VERSION parameter
[releng/global-jjb.git] / jjb / lf-ci-jobs.yaml
1 ---
2 ####################
3 # COMMON FUNCTIONS #
4 ####################
5
6 - builder:
7     name: lf-infra-jjbini
8     builders:
9       - config-file-provider:
10           files:
11             - file-id: jjbini
12               target: "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
13
14 - lf_packer: &lf_packer_common
15     name: lf-packer-common
16     # Provide configuration common in packer jobs.
17
18     ######################
19     # Default parameters #
20     ######################
21
22     branch: master
23     build-timeout: 90
24     cron: "@monthly"
25     disable-job: false
26     github-url: "https://github.com"
27     stream: master
28     submodule-recursive: true
29     submodule-timeout: 10
30     submodule-disable: false
31     packer-cloud-settings: packer-cloud-env
32     packer-version: 1.4.2
33
34     #####################
35     # Job Configuration #
36     #####################
37
38     project-type: freestyle
39     node: "{build-node}"
40     disabled: "{disable-job}"
41
42     properties:
43       - lf-infra-properties:
44           project: "{project}"
45           build-days-to-keep: 7
46
47     parameters:
48       - lf-infra-parameters:
49           project: "{project}"
50           stream: "{stream}"
51           branch: "{branch}"
52       - lf-packer-parameters:
53           packer-version: "{packer-version}"
54
55     wrappers:
56       - lf-infra-wrappers:
57           build-timeout: "{build-timeout}"
58           jenkins-ssh-credential: "{jenkins-ssh-credential}"
59
60     publishers:
61       - lf-infra-publish
62
63 - parameter:
64     name: lf-infra-jjb-parameters
65     parameters:
66       - string:
67           name: JJB_VERSION
68           default: "{jjb-version}"
69           description: Jenkins Job Builder version to download and install.
70       - string:
71           name: XDG_CACHE_HOME
72           default: "{jjb-cache}"
73           description: Jenkins Job Builder cache location.
74
75 - parameter:
76     name: lf-packer-parameters
77     parameters:
78       - string:
79           name: PACKER_VERSION
80           default: "{packer-version}"
81           description: Packer version to download and install.
82
83 - parameter:
84     name: lf-puppet-parameters
85     parameters:
86       - string:
87           name: PUPPET_LINT_VERSION
88           default: "{puppet-lint-version}"
89           description: Puppet-lint version to download and install.
90
91 - lf_jjb_common: &lf_jjb_common
92     name: lf-jjb-common
93
94     ######################
95     # Default parameters #
96     ######################
97
98     branch: master
99     build-timeout: 10
100     disable-job: false
101     github-url: "https://github.com"
102     jjb-cache: "$HOME/.cache/jenkins_jobs"
103     jjb-version: 2.8.0
104     stream: master
105     submodule-recursive: true
106     submodule-timeout: 10
107     submodule-disable: false
108     throttle_categories: []
109     throttle-enabled: false
110     throttle-max-per-node: 1
111     throttle-max-total: 0
112     throttle-option: "project"
113
114     gerrit_trigger_file_paths:
115       - compare-type: REG_EXP
116         pattern: "jjb/.*"
117       - compare-type: REG_EXP
118         pattern: "global-jjb"
119       - compare-type: REG_EXP
120         pattern: "shell/.*"
121
122     # github_included_regions MUST match gerrit_trigger_file_paths
123     github_included_regions:
124       - "jjb/.*"
125       - "global-jjb"
126       - "shell/.*"
127
128     #####################
129     # Job Configuration #
130     #####################
131
132     project-type: freestyle
133     node: "{build-node}"
134     disabled: "{disable-job}"
135
136     properties:
137       - lf-infra-properties:
138           project: "{project}"
139           build-days-to-keep: 7
140       - throttle:
141           categories: "{obj:throttle_categories}"
142           enabled: "{throttle-enabled}"
143           max-per-node: "{throttle-max-per-node}"
144           max-total: "{throttle-max-total}"
145           option: "{throttle-option}"
146
147     parameters:
148       - lf-infra-parameters:
149           project: "{project}"
150           stream: "{stream}"
151           branch: "{branch}"
152       - lf-infra-jjb-parameters:
153           jjb-cache: "{jjb-cache}"
154           jjb-version: "{jjb-version}"
155
156     wrappers:
157       - lf-infra-wrappers:
158           build-timeout: "{build-timeout}"
159           jenkins-ssh-credential: "{jenkins-ssh-credential}"
160
161     publishers:
162       - lf-infra-publish
163
164 ######################
165 # Gerrit Branch Lock #
166 ######################
167
168 - job-template:
169     name: "{project-name}-gerrit-branch-lock"
170     id: gerrit-branch-lock
171
172     ######################
173     # Default parameters #
174     ######################
175
176     branch: "**"
177     disable-job: false
178     git-url: "$GIT_URL/$GERRIT_PROJECT"
179     submodule-timeout: 10
180     submodule-disable: true
181     gerrit_merge_triggers:
182       - comment-added-contains-event:
183           comment-contains-value: (un)?lock branch$
184
185     #####################
186     # Job Configuration #
187     #####################
188
189     project-type: freestyle
190     node: "{build-node}"
191     disabled: "{disable-job}"
192
193     properties:
194       - lf-infra-properties:
195           project: "{project}"
196           build-days-to-keep: 1
197
198     parameters:
199       - lf-infra-parameters:
200           project: "{project}"
201           stream: ""
202           branch: "{branch}"
203
204     wrappers:
205       - lf-infra-wrappers:
206           build-timeout: 5
207           jenkins-ssh-credential: "{jenkins-ssh-credential}"
208
209     scm:
210       - lf-infra-gerrit-scm:
211           git-url: "{git-url}"
212           refspec: ""
213           branch: "$GERRIT_BRANCH"
214           submodule-recursive: false
215           submodule-timeout: "{submodule-timeout}"
216           submodule-disable: "{submodule-disable}"
217           choosing-strategy: default
218           jenkins-ssh-credential: "{jenkins-ssh-credential}"
219
220     triggers:
221       - gerrit:
222           server-name: "{gerrit-server-name}"
223           trigger-on: "{obj:gerrit_merge_triggers}"
224           projects:
225             - project-compare-type: ANT
226               project-pattern: "**"
227               branches:
228                 - branch-compare-type: ANT
229                   branch-pattern: "**/{branch}"
230
231     builders:
232       - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
233
234     publishers:
235       - lf-infra-publish
236
237 ##########################################
238 # Jenkins Configuration Management Merge #
239 ##########################################
240
241 - builder:
242     name: lf-jenkins-cfg-clouds
243     builders:
244       - lf-infra-jjbini
245       - inject:
246           properties-content: "jenkins_silos={jenkins-silos}"
247       - shell: !include-raw-escape: ../shell/jenkins-configure-clouds.sh
248       - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
249
250 - builder:
251     name: lf-jenkins-cfg-global-vars
252     builders:
253       - lf-infra-jjbini
254       - inject:
255           properties-content: "jenkins_silos={jenkins-silos}"
256       - shell: !include-raw-escape: ../shell/jenkins-configure-global-vars.sh
257       - shell: rm -f "$HOME/.config/jenkins_jobs/jenkins_jobs.ini"
258
259 - lf_jenkins_configuration: &lf_jenkins_cfg_merge
260     name: lf-jenkins-cfg-merge
261
262     ######################
263     # Default parameters #
264     ######################
265
266     branch: master
267     cron: "@daily"
268     disable-job: false
269     git-url: "$GIT_URL/$GERRIT_PROJECT"
270     github-url: "https://github.com"
271     jenkins-silos: production sandbox
272     submodule-timeout: 10
273     submodule-disable: false
274
275     gerrit_merge_triggers:
276       - change-merged-event
277       - comment-added-contains-event:
278           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
279
280     gerrit_trigger_file_paths:
281       - compare-type: REG_EXP
282         pattern: 'jenkins-config\/.*'
283
284     # github_included_regions MUST match gerrit_trigger_file_paths
285     github_included_regions:
286       - 'jenkins-config\/.*'
287
288     #####################
289     # Job Configuration #
290     #####################
291
292     project-type: freestyle
293     node: "{build-node}"
294     concurrent: false
295     disabled: "{disable-job}"
296
297     properties:
298       - lf-infra-properties:
299           project: "{project}"
300           build-days-to-keep: 1
301
302     parameters:
303       - lf-infra-parameters:
304           project: "{project}"
305           stream: ""
306           branch: master
307
308     wrappers:
309       - lf-infra-wrappers:
310           build-timeout: 10
311           jenkins-ssh-credential: "{jenkins-ssh-credential}"
312
313     builders:
314       - lf-infra-pre-build
315       - lf-jenkins-cfg-global-vars:
316           jenkins-silos: "{jenkins-silos}"
317       - lf-jenkins-cfg-clouds:
318           jenkins-silos: "{jenkins-silos}"
319
320     publishers:
321       - lf-infra-publish
322
323 - job-template:
324     name: "{project-name}-jenkins-cfg-merge"
325     id: gerrit-jenkins-cfg-merge
326     <<: *lf_jenkins_cfg_merge
327
328     scm:
329       - lf-infra-gerrit-scm:
330           git-url: "{git-url}"
331           refspec: "refs/heads/{branch}"
332           branch: "{branch}"
333           submodule-recursive: true
334           submodule-timeout: "{submodule-timeout}"
335           submodule-disable: "{submodule-disable}"
336           choosing-strategy: default
337           jenkins-ssh-credential: "{jenkins-ssh-credential}"
338
339     triggers:
340       - timed: "{obj:cron}"
341       - gerrit:
342           server-name: "{gerrit-server-name}"
343           trigger-on: "{obj:gerrit_merge_triggers}"
344           projects:
345             - project-compare-type: ANT
346               project-pattern: "{project}"
347               branches:
348                 - branch-compare-type: ANT
349                   branch-pattern: "**/{branch}"
350               file-paths: "{obj:gerrit_trigger_file_paths}"
351
352 - job-template:
353     name: "{project-name}-jenkins-cfg-merge"
354     id: github-jenkins-cfg-merge
355     <<: *lf_jenkins_cfg_merge
356
357     properties:
358       - lf-infra-properties:
359           project: "{project}"
360           build-days-to-keep: 1
361       - github:
362           url: "{github-url}/{github-org}/{project}"
363
364     scm:
365       - lf-infra-github-scm:
366           url: "{git-clone-url}{github-org}/{project}"
367           refspec: ""
368           branch: "refs/heads/{branch}"
369           submodule-recursive: true
370           submodule-timeout: "{submodule-timeout}"
371           submodule-disable: "{submodule-disable}"
372           choosing-strategy: default
373           jenkins-ssh-credential: "{jenkins-ssh-credential}"
374
375     triggers:
376       - timed: "{obj:cron}"
377       - github
378       - pollscm:
379           cron: ""
380       - github-pull-request:
381           trigger-phrase: "^remerge$"
382           only-trigger-phrase: true
383           status-context: "Jenkins CFG Merge"
384           permit-all: true
385           github-hooks: true
386           org-list:
387             - "{github-org}"
388           white-list: "{obj:github_pr_whitelist}"
389           admin-list: "{obj:github_pr_admin_list}"
390           included-regions: "{obj:github_included_regions}"
391           white-list-target-branches:
392             - "{branch}"
393
394 ###########################################
395 # Jenkins Configuration Management Verify #
396 ###########################################
397
398 - lf_jenkins_configuration: &lf_jenkins_cfg_verify
399     name: lf-jenkins-cfg-verify
400
401     ######################
402     # Default parameters #
403     ######################
404
405     branch: master
406     build-days-to-keep: 7
407     disable-job: false
408     git-url: "$GIT_URL/$GERRIT_PROJECT"
409     github-url: "https://github.com"
410     submodule-timeout: 10
411     submodule-disable: false
412
413     gerrit_verify_triggers:
414       - patchset-created-event:
415           exclude-drafts: true
416           exclude-trivial-rebase: false
417           exclude-no-code-change: false
418       - draft-published-event
419       - comment-added-contains-event:
420           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
421
422     gerrit_trigger_file_paths:
423       - compare-type: REG_EXP
424         pattern: 'jenkins-config\/.*'
425
426     # github_included_regions MUST match gerrit_trigger_file_paths
427     github_included_regions:
428       - 'jenkins-config\/.*'
429
430     #####################
431     # Job Configuration #
432     #####################
433
434     project-type: freestyle
435     node: "{build-node}"
436     concurrent: true
437     disabled: "{disable-job}"
438
439     properties:
440       - lf-infra-properties:
441           project: "{project}"
442           build-days-to-keep: 1
443
444     parameters:
445       - lf-infra-parameters:
446           project: "{project}"
447           stream: ""
448           branch: master
449
450     wrappers:
451       - lf-infra-wrappers:
452           build-timeout: 10
453           jenkins-ssh-credential: "{jenkins-ssh-credential}"
454       - config-file-provider:
455           # Listed after to override openstack-infra-wrappers clouds.yaml
456           # definition
457           files:
458             - file-id: clouds-yaml
459               target: "$HOME/.config/openstack/clouds.yaml"
460             - file-id: npmrc
461               target: "$HOME/.npmrc"
462             - file-id: pipconf
463               target: "$HOME/.config/pip/pip.conf"
464
465     builders:
466       - lf-infra-pre-build
467       - shell: !include-raw-escape: ../shell/jenkins-verify-images.sh
468
469     publishers:
470       - lf-infra-publish
471
472 - job-template:
473     name: "{project-name}-jenkins-cfg-verify"
474     id: gerrit-jenkins-cfg-verify
475     <<: *lf_jenkins_cfg_verify
476
477     scm:
478       - lf-infra-gerrit-scm:
479           git-url: "{git-url}"
480           refspec: "$GERRIT_REFSPEC"
481           branch: "$GERRIT_BRANCH"
482           submodule-recursive: true
483           submodule-timeout: "{submodule-timeout}"
484           submodule-disable: "{submodule-disable}"
485           choosing-strategy: gerrit
486           jenkins-ssh-credential: "{jenkins-ssh-credential}"
487
488     triggers:
489       - gerrit:
490           server-name: "{gerrit-server-name}"
491           trigger-on: "{obj:gerrit_verify_triggers}"
492           projects:
493             - project-compare-type: ANT
494               project-pattern: "{project}"
495               branches:
496                 - branch-compare-type: ANT
497                   branch-pattern: "**/{branch}"
498               file-paths: "{obj:gerrit_trigger_file_paths}"
499
500 - job-template:
501     name: "{project-name}-jenkins-cfg-verify"
502     id: github-jenkins-cfg-verify
503     <<: *lf_jenkins_cfg_verify
504
505     properties:
506       - github:
507           url: "{github-url}/{github-org}/{project}"
508
509     scm:
510       - lf-infra-github-scm:
511           url: "{git-clone-url}{github-org}/{project}"
512           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
513           branch: "$sha1"
514           submodule-recursive: true
515           submodule-timeout: "{submodule-timeout}"
516           submodule-disable: "{submodule-disable}"
517           choosing-strategy: default
518           jenkins-ssh-credential: "{jenkins-ssh-credential}"
519
520     triggers:
521       - github-pull-request:
522           trigger-phrase: "^(recheck|reverify)$"
523           only-trigger-phrase: false
524           status-context: "Jenkins CFG Verify"
525           permit-all: true
526           github-hooks: true
527           included-regions: "{obj:github_included_regions}"
528           white-list-target-branches:
529             - "{branch}"
530
531 ###########################
532 # JENKINS SANDBOX CLEANUP #
533 ###########################
534
535 - lf_jenkins_sandbox_cleanup: &lf_jenkins_sandbox_cleanup
536     name: lf-jenkins-sandbox-cleanup
537
538     ######################
539     # Default parameters #
540     ######################
541
542     build-timeout: 30
543     # Run every Saturday at 08:00 UTC
544     cron: "0 8 * * 6"
545     disable-job: false
546
547     #####################
548     # Job Configuration #
549     #####################
550
551     project-type: freestyle
552     node: "{build-node}"
553     concurrent: true
554     disabled: "{disable-job}"
555
556     parameters:
557       - lf-infra-jjb-parameters:
558           jjb-cache: "{jjb-cache}"
559           jjb-version: "{jjb-version}"
560
561     triggers:
562       - timed: "{obj:cron}"
563
564     builders:
565       - lf-infra-jjbini
566       - shell: !include-raw-escape:
567           - ../shell/jenkins-sandbox-cleanup.sh
568
569 - job-template:
570     name: "{project-name}-jenkins-sandbox-cleanup"
571     id: gerrit-jenkins-sandbox-cleanup
572     <<: *lf_jjb_common
573     # yamllint disable-line rule:key-duplicates
574     <<: *lf_jenkins_sandbox_cleanup
575
576 - job-template:
577     name: "{project-name}-jenkins-sandbox-cleanup"
578     id: github-jenkins-sandbox-cleanup
579     <<: *lf_jjb_common
580     # yamllint disable-line rule:key-duplicates
581     <<: *lf_jenkins_sandbox_cleanup
582
583 ##################
584 # JJB DEPLOY JOB #
585 ##################
586
587 - lf_jjb_deploy_job: &lf_jjb_deploy_job
588     name: lf-jjb-deploy-job
589
590     ######################
591     # Default parameters #
592     ######################
593
594     branch: master
595     disable-job: false
596     # jjb-deploy should always clone $PROJECT regardless of what
597     # $GERRIT_PROJECT triggered the job.
598     git-url: "$GIT_URL/$PROJECT"
599     github-url: "https://github.com"
600     stream: master
601     submodule-timeout: 10
602     submodule-disable: false
603     gerrit_jjb_deploy_job_triggers:
604       - comment-added-contains-event:
605           comment-contains-value: '^Patch Set\s+\d+:\s+(jjb-deploy[:]* (?!\*+$).+$)'
606
607     #####################
608     # Job Configuration #
609     #####################
610
611     project-type: freestyle
612     node: "{build-node}"
613     concurrent: true
614     disabled: "{disable-job}"
615
616     properties:
617       - lf-infra-properties:
618           project: "{project}"
619           build-days-to-keep: 1
620
621     parameters:
622       - lf-infra-parameters:
623           project: "{project}"
624           stream: "{stream}"
625           branch: "{branch}"
626       - lf-infra-jjb-parameters:
627           jjb-cache: "{jjb-cache}"
628           jjb-version: "{jjb-version}"
629
630     wrappers:
631       - lf-infra-wrappers:
632           build-timeout: 5
633           jenkins-ssh-credential: "{jenkins-ssh-credential}"
634
635     builders:
636       - lf-infra-jjbini
637       - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
638
639     publishers:
640       - lf-infra-publish
641
642 - job-template:
643     name: "{project-name}-jjb-deploy-job"
644     id: gerrit-jjb-deploy-job
645     <<: *lf_jjb_common
646     # yamllint disable-line rule:key-duplicates
647     <<: *lf_jjb_deploy_job
648
649     scm:
650       - lf-infra-gerrit-scm:
651           git-url: "{git-url}"
652           refspec: "refs/heads/{branch}"
653           branch: "{branch}"
654           submodule-recursive: true
655           submodule-timeout: "{submodule-timeout}"
656           submodule-disable: "{submodule-disable}"
657           choosing-strategy: default
658           jenkins-ssh-credential: "{jenkins-ssh-credential}"
659
660     triggers:
661       - gerrit:
662           server-name: "{gerrit-server-name}"
663           trigger-on: "{obj:gerrit_jjb_deploy_job_triggers}"
664           projects:
665             - project-compare-type: ANT
666               project-pattern: "**"
667               branches:
668                 - branch-compare-type: ANT
669                   branch-pattern: "**"
670           skip-vote:
671             success: true
672             failed: true
673             unstable: true
674             notbuilt: true
675
676 - job-template:
677     name: "{project-name}-jjb-deploy-job"
678     id: github-jjb-deploy-job
679     <<: *lf_jjb_common
680     # yamllint disable-line rule:key-duplicates
681     <<: *lf_jjb_deploy_job
682
683     properties:
684       - lf-infra-properties:
685           project: "{project}"
686           build-days-to-keep: 1
687       - github:
688           url: "{github-url}/{github-org}/{project}"
689
690     scm:
691       - lf-infra-github-scm:
692           url: "{git-clone-url}{github-org}/{project}"
693           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
694           branch: "$sha1"
695           submodule-recursive: true
696           submodule-timeout: "{submodule-timeout}"
697           submodule-disable: "{submodule-disable}"
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     jjb-workers: 0
723
724     gerrit_merge_triggers:
725       - change-merged-event
726       - comment-added-contains-event:
727           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
728
729     #####################
730     # Job Configuration #
731     #####################
732
733     builders:
734       - lf-infra-pre-build
735       - lf-infra-jjbini
736       - inject:
737           properties-content: JJB_WORKERS={jjb-workers}
738       - shell: !include-raw-escape:
739           - ../shell/jjb-merge-job.sh
740
741 - job-template:
742     name: "{project-name}-jjb-merge"
743     id: gerrit-jjb-merge
744     <<: *lf_jjb_common
745     # yamllint disable-line rule:key-duplicates
746     <<: *lf_jjb_merge
747
748     git-url: "$GIT_URL/$GERRIT_PROJECT"
749
750     scm:
751       - lf-infra-gerrit-scm:
752           git-url: "{git-url}"
753           refspec: ""
754           branch: "{branch}"
755           submodule-recursive: "{submodule-recursive}"
756           submodule-timeout: "{submodule-timeout}"
757           submodule-disable: "{submodule-disable}"
758           choosing-strategy: default
759           jenkins-ssh-credential: "{jenkins-ssh-credential}"
760
761     triggers:
762       - gerrit:
763           server-name: "{gerrit-server-name}"
764           trigger-on: "{obj:gerrit_merge_triggers}"
765           projects:
766             - project-compare-type: ANT
767               project-pattern: "{project}"
768               branches:
769                 - branch-compare-type: ANT
770                   branch-pattern: "**/{branch}"
771               file-paths: "{obj:gerrit_trigger_file_paths}"
772
773 - job-template:
774     name: "{project-name}-jjb-merge"
775     id: github-jjb-merge
776     <<: *lf_jjb_common
777     # yamllint disable-line rule:key-duplicates
778     <<: *lf_jjb_merge
779
780     #####################
781     # Job Configuration #
782     #####################
783
784     properties:
785       - lf-infra-properties:
786           project: "{project}"
787           build-days-to-keep: 7
788       - github:
789           url: "{github-url}/{github-org}/{project}"
790
791     scm:
792       - lf-infra-github-scm:
793           url: "{git-clone-url}{github-org}/{project}"
794           refspec: ""
795           branch: "refs/heads/{branch}"
796           submodule-recursive: "{submodule-recursive}"
797           submodule-timeout: "{submodule-timeout}"
798           submodule-disable: "{submodule-disable}"
799           choosing-strategy: default
800           jenkins-ssh-credential: "{jenkins-ssh-credential}"
801
802     triggers:
803       - github
804       - pollscm:
805           cron: ""
806       - github-pull-request:
807           trigger-phrase: "^remerge$"
808           only-trigger-phrase: true
809           status-context: "JJB Merge"
810           permit-all: true
811           github-hooks: true
812           org-list:
813             - "{github-org}"
814           white-list: "{obj:github_pr_whitelist}"
815           admin-list: "{obj:github_pr_admin_list}"
816           included-regions: "{obj:github_included_regions}"
817           white-list-target-branches:
818             - "{branch}"
819
820 ##############
821 # JJB Verify #
822 ##############
823
824 - lf_jjb_verify: &lf_jjb_verify
825     name: lf-jjb-verify
826
827     ######################
828     # Default parameters #
829     ######################
830
831     build-concurrent: true
832     build-node-label-check: false
833     build-node-label-list: ""
834
835     gerrit_verify_triggers:
836       - patchset-created-event:
837           exclude-drafts: true
838           exclude-trivial-rebase: false
839           exclude-no-code-change: false
840       - draft-published-event
841       - comment-added-contains-event:
842           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
843
844     #####################
845     # Job Configuration #
846     #####################
847
848     concurrent: "{build-concurrent}"
849
850     builders:
851       - lf-infra-pre-build
852       - lf-infra-jjbini
853       - shell: !include-raw-escape:
854           - ../shell/jjb-verify-job.sh
855       - conditional-step:
856           condition-kind: boolean-expression
857           condition-expression: "{build-node-label-check}"
858           on-evaluation-failure: dont-run
859           steps:
860             - inject:
861                 properties-content: EXTERNAL_LABELS="{build-node-label-list}"
862             - shell: !include-raw-escape:
863                 - ../shell/jjb-verify-build-nodes.sh
864       - lf-infra-gpg-verify-git-signature
865
866 - job-template:
867     name: "{project-name}-jjb-verify"
868     id: gerrit-jjb-verify
869     <<: *lf_jjb_common
870     # yamllint disable-line rule:key-duplicates
871     <<: *lf_jjb_verify
872
873     ######################
874     # Default parameters #
875     ######################
876
877     git-url: "$GIT_URL/$GERRIT_PROJECT"
878
879     #####################
880     # Job Configuration #
881     #####################
882
883     scm:
884       - lf-infra-gerrit-scm:
885           git-url: "{git-url}"
886           refspec: "$GERRIT_REFSPEC"
887           branch: "$GERRIT_BRANCH"
888           submodule-recursive: "{submodule-recursive}"
889           submodule-timeout: "{submodule-timeout}"
890           submodule-disable: "{submodule-disable}"
891           choosing-strategy: gerrit
892           jenkins-ssh-credential: "{jenkins-ssh-credential}"
893
894     triggers:
895       - gerrit:
896           server-name: "{gerrit-server-name}"
897           trigger-on: "{obj:gerrit_verify_triggers}"
898           projects:
899             - project-compare-type: ANT
900               project-pattern: "{project}"
901               branches:
902                 - branch-compare-type: ANT
903                   branch-pattern: "**/{branch}"
904               file-paths: "{obj:gerrit_trigger_file_paths}"
905
906 - job-template:
907     name: "{project-name}-jjb-verify"
908     id: github-jjb-verify
909     <<: *lf_jjb_common
910     # yamllint disable-line rule:key-duplicates
911     <<: *lf_jjb_verify
912
913     #####################
914     # Job Configuration #
915     #####################
916
917     properties:
918       - lf-infra-properties:
919           project: "{project}"
920           build-days-to-keep: 7
921       - github:
922           url: "{github-url}/{github-org}/{project}"
923
924     scm:
925       - lf-infra-github-scm:
926           url: "{git-clone-url}{github-org}/{project}"
927           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
928           branch: "$sha1"
929           submodule-recursive: "{submodule-recursive}"
930           submodule-timeout: "{submodule-timeout}"
931           submodule-disable: "{submodule-disable}"
932           choosing-strategy: default
933           jenkins-ssh-credential: "{jenkins-ssh-credential}"
934
935     triggers:
936       - github-pull-request:
937           trigger-phrase: "^(recheck|reverify)$"
938           only-trigger-phrase: false
939           status-context: "JJB Verify"
940           permit-all: true
941           github-hooks: true
942           included-regions: "{obj:github_included_regions}"
943           white-list-target-branches:
944             - "{branch}"
945
946 ############################
947 # JJB Verify Upstream GJJB #
948 ############################
949
950 - lf_jjb_verify: &lf_jjb_verify_upstream_gjjb
951     name: lf-jjb-verify-upstream-gjjb
952
953     #####################
954     # Job Configuration #
955     #####################
956
957     concurrent: true
958
959     builders:
960       - shell: |
961           cd global-jjb
962           git fetch https://gerrit.linuxfoundation.org/infra/releng/global-jjb $GERRIT_REFSPEC
963           git cherry-pick FETCH_HEAD
964       - lf-infra-jjbini
965       - shell: !include-raw-escape:
966           - ../shell/jjb-verify-job.sh
967
968     # All jobs are triggering from the same source
969     triggers:
970       - gerrit:
971           server-name: "lf-releng"
972           trigger-on:
973             - patchset-created-event:
974                 exclude-drafts: true
975                 exclude-trivial-rebase: false
976                 exclude-no-code-change: false
977             - draft-published-event
978             - comment-added-contains-event:
979                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
980           projects:
981             - project-compare-type: ANT
982               project-pattern: "releng/global-jjb"
983               branches:
984                 - branch-compare-type: ANT
985                   branch-pattern: "**/master"
986           override-votes: true
987           gerrit-build-failed-codereview-value: -1
988           gerrit-build-failed-verified-value: 0
989           gerrit-build-successful-codereview-value: 1
990           gerrit-build-successful-verified-value: 0
991
992 - job-template:
993     name: "{project-name}-jjb-verify-upstream-gjjb"
994     id: gerrit-jjb-verify-upstream-gjjb
995     <<: *lf_jjb_common
996     # yamllint disable-line rule:key-duplicates
997     <<: *lf_jjb_verify_upstream_gjjb
998
999     ######################
1000     # Default parameters #
1001     ######################
1002
1003     git-url: "$GIT_URL/$PROJECT"
1004     submodule-timeout: 10
1005     submodule-disable: false
1006
1007     #####################
1008     # Job Configuration #
1009     #####################
1010
1011     scm:
1012       - lf-infra-gerrit-scm:
1013           git-url: "{git-url}"
1014           refspec: ""
1015           branch: "master"
1016           submodule-recursive: true
1017           submodule-timeout: "{submodule-timeout}"
1018           submodule-disable: "{submodule-disable}"
1019           choosing-strategy: default
1020           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1021
1022 - job-template:
1023     name: "{project-name}-jjb-verify-upstream-gjjb"
1024     id: github-jjb-verify-upstream-gjjb
1025     <<: *lf_jjb_common
1026     # yamllint disable-line rule:key-duplicates
1027     <<: *lf_jjb_verify_upstream_gjjb
1028
1029     ######################
1030     # Default parameters #
1031     ######################
1032
1033     git-url: "$GIT_URL/$PROJECT"
1034     submodule-timeout: 10
1035     submodule-disable: false
1036
1037     #####################
1038     # Job Configuration #
1039     #####################
1040
1041     properties:
1042       - lf-infra-properties:
1043           project: "{project}"
1044           build-days-to-keep: 7
1045       - github:
1046           url: "{github-url}/{github-org}/{project}"
1047
1048     scm:
1049       - lf-infra-github-scm:
1050           url: "{git-clone-url}{github-org}/{project}"
1051           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1052           branch: "$sha1"
1053           submodule-recursive: "{submodule-recursive}"
1054           submodule-timeout: "{submodule-timeout}"
1055           submodule-disable: "{submodule-disable}"
1056           choosing-strategy: default
1057           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1058
1059 #################
1060 # License Check #
1061 #################
1062
1063 - lf_license_check: &lf_license_check
1064     name: lf-license-check
1065
1066     ######################
1067     # Default parameters #
1068     ######################
1069
1070     branch: master
1071     build-days-to-keep: 7
1072     build-timeout: 15
1073     disable-job: false
1074     file-patterns: >
1075       *.go
1076       *.groovy
1077       *.java
1078       *.py
1079       *.sh
1080     git-url: "$GIT_URL/$PROJECT"
1081     github-url: "https://github.com"
1082     lhc-version: 0.2.0
1083     license-exclude-paths: ""
1084     licenses-allowed: Apache-2.0,EPL-1.0,MIT
1085     project-pattern: "**"
1086     spdx-disable: false
1087     stream: master
1088     submodule-timeout: 10
1089     submodule-disable: false
1090
1091     #####################
1092     # Job Configuration #
1093     #####################
1094
1095     project-type: freestyle
1096     node: "{build-node}"
1097     concurrent: true
1098     disabled: "{disable-job}"
1099
1100     properties:
1101       - lf-infra-properties:
1102           build-days-to-keep: "{build-days-to-keep}"
1103
1104     parameters:
1105       - lf-infra-parameters:
1106           project: "{project}"
1107           branch: "{branch}"
1108           stream: "{stream}"
1109
1110     wrappers:
1111       - lf-infra-wrappers:
1112           build-timeout: "{build-timeout}"
1113           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1114
1115     builders:
1116       - lf-license-check:
1117           file-patterns: "{file-patterns}"
1118           spdx-disable: "{spdx-disable}"
1119           lhc-version: "{lhc-version}"
1120           license-exclude-paths: "{license-exclude-paths}"
1121           licenses-allowed: "{licenses-allowed}"
1122
1123     publishers:
1124       - lf-infra-publish
1125
1126 - job-template:
1127     name: "{project-name}-license-check"
1128     id: gerrit-license-check
1129     <<: *lf_license_check
1130
1131     git-url: "$GIT_URL/$GERRIT_PROJECT"
1132
1133     scm:
1134       - lf-infra-gerrit-scm:
1135           git-url: "{git-url}"
1136           refspec: "$GERRIT_REFSPEC"
1137           branch: "$GERRIT_BRANCH"
1138           # Submodules are out of the project's control
1139           submodule-recursive: false
1140           submodule-timeout: "{submodule-timeout}"
1141           submodule-disable: "{submodule-disable}"
1142           choosing-strategy: gerrit
1143           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1144
1145     triggers:
1146       - gerrit:
1147           server-name: "{gerrit-server-name}"
1148           # Trigger should not be overridable as we want to always run
1149           trigger-on:
1150             - patchset-created-event:
1151                 exclude-drafts: false
1152                 exclude-trivial-rebase: false
1153                 exclude-no-code-change: false
1154             - draft-published-event
1155             - comment-added-contains-event:
1156                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1157           projects:
1158             - project-compare-type: ANT
1159               project-pattern: "{project-pattern}"
1160               branches:
1161                 - branch-compare-type: ANT
1162                   branch-pattern: "**"
1163
1164 - job-template:
1165     name: "{project-name}-license-check"
1166     id: github-license-check
1167     <<: *lf_license_check
1168
1169     properties:
1170       - lf-infra-properties:
1171           build-days-to-keep: "{build-days-to-keep}"
1172       - github:
1173           url: "{github-url}/{github-org}/{project}"
1174
1175     scm:
1176       - lf-infra-github-scm:
1177           url: "{git-clone-url}{github-org}/{project}"
1178           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1179           branch: "$sha1"
1180           # Submodules are out of the project's control
1181           submodule-recursive: false
1182           submodule-timeout: "{submodule-timeout}"
1183           submodule-disable: "{submodule-disable}"
1184           choosing-strategy: default
1185           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1186
1187     triggers:
1188       - github-pull-request:
1189           trigger-phrase: "^recheck$"
1190           only-trigger-phrase: false
1191           status-context: "License Check"
1192           permit-all: true
1193           github-hooks: true
1194           white-list-target-branches:
1195             - "{branch}"
1196
1197 ####################
1198 # Info YAML Verify #
1199 ####################
1200
1201 - lf_info_yaml_verify: &lf_info_yaml_verify
1202     name: lf-info-yaml-verify
1203
1204     ######################
1205     # Default parameters #
1206     ######################
1207
1208     gerrit_verify_triggers:
1209       - patchset-created-event:
1210           exclude-drafts: true
1211           exclude-trivial-rebase: false
1212           exclude-no-code-change: false
1213       - draft-published-event
1214       - comment-added-contains-event:
1215           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1216
1217     #####################
1218     # Job Configuration #
1219     #####################
1220
1221     concurrent: true
1222
1223     builders:
1224       - shell: !include-raw-escape:
1225           - ../shell/git-validate-info-yaml.sh
1226           - ../shell/info-file-validate.sh
1227
1228 - job-template:
1229     name: "{project-name}-info-yaml-verify"
1230     id: gerrit-info-yaml-verify
1231     <<: *lf_jjb_common
1232     # yamllint disable-line rule:key-duplicates
1233     <<: *lf_info_yaml_verify
1234
1235     git-url: "$GIT_URL/$GERRIT_PROJECT"
1236
1237     scm:
1238       - lf-infra-gerrit-scm:
1239           git-url: "{git-url}"
1240           refspec: "$GERRIT_REFSPEC"
1241           branch: "$GERRIT_BRANCH"
1242           submodule-recursive: "{submodule-recursive}"
1243           submodule-timeout: "{submodule-timeout}"
1244           submodule-disable: "{submodule-disable}"
1245           choosing-strategy: gerrit
1246           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1247
1248     triggers:
1249       - gerrit:
1250           server-name: "{gerrit-server-name}"
1251           trigger-on: "{obj:gerrit_verify_triggers}"
1252           projects:
1253             - project-compare-type: ANT
1254               project-pattern: "{project}"
1255               branches:
1256                 - branch-compare-type: ANT
1257                   branch-pattern: "**/{branch}"
1258               file-paths:
1259                 - compare-type: REG_EXP
1260                   pattern: "INFO.yaml"
1261
1262 - job-template:
1263     name: "{project-name}-info-yaml-verify"
1264     id: github-info-yaml-verify
1265     <<: *lf_jjb_common
1266     # yamllint disable-line rule:key-duplicates
1267     <<: *lf_info_yaml_verify
1268
1269     github-url: "https://github.com"
1270     properties:
1271       - github:
1272           url: "{github-url}/{github-org}/{project}"
1273
1274     scm:
1275       - lf-infra-github-scm:
1276           url: "{git-clone-url}{github-org}/{project}"
1277           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1278           branch: "$sha1"
1279           submodule-recursive: "{submodule-recursive}"
1280           submodule-timeout: "{submodule-timeout}"
1281           submodule-disable: "{submodule-disable}"
1282           choosing-strategy: default
1283           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1284
1285     triggers:
1286       - github-pull-request:
1287           trigger-phrase: "^(recheck|reverify)$"
1288           only-trigger-phrase: false
1289           status-context: "INFO File Verify"
1290           permit-all: true
1291           github-hooks: true
1292           # included-regions MUST match gerrit file-paths
1293           included-regions: "INFO.yaml"
1294           white-list-target-branches:
1295             - "{branch}"
1296
1297 ##################
1298 # OPENSTACK CRON #
1299 ##################
1300
1301 - lf_openstack_cron: &lf_openstack_cron
1302     name: lf-openstack-cron
1303
1304     ######################
1305     # Default parameters #
1306     ######################
1307
1308     branch: master
1309     build-days-to-keep: 7
1310     build-timeout: 10
1311     cron: "@hourly"
1312     disable-job: false
1313     git-url: "$GIT_URL/$PROJECT"
1314     github-url: "https://github.com"
1315     openstack-cloud: vex
1316     openstack-image-cleanup: true
1317     openstack-image-cleanup-age: 30
1318     openstack-image-protect: true
1319     openstack-port-cleanup: true
1320     openstack-server-cleanup: true
1321     openstack-stack-cleanup: true
1322     openstack-volume-cleanup: true
1323     stream: master
1324     submodule-timeout: 10
1325     submodule-disable: false
1326
1327     #####################
1328     # Job Configuration #
1329     #####################
1330
1331     project-type: freestyle
1332     node: "{build-node}"
1333     concurrent: false
1334     disabled: "{disable-job}"
1335
1336     properties:
1337       - lf-infra-properties:
1338           build-days-to-keep: "{build-days-to-keep}"
1339
1340     parameters:
1341       - lf-infra-parameters:
1342           project: "{project}"
1343           stream: "{stream}"
1344           branch: "{branch}"
1345       - string:
1346           name: JENKINS_URLS
1347           default: "{jenkins-urls}"
1348           description: |
1349             Space separated list of Jenkins URLs to check for active builds.
1350
1351     wrappers:
1352       - lf-infra-wrappers:
1353           build-timeout: "{build-timeout}"
1354           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1355       # Listed after to override openstack-infra-wrappers clouds.yaml definition
1356       - config-file-provider:
1357           files:
1358             - file-id: clouds-yaml
1359               target: "$HOME/.config/openstack/clouds.yaml"
1360             - file-id: npmrc
1361               target: "$HOME/.npmrc"
1362             - file-id: pipconf
1363               target: "$HOME/.config/pip/pip.conf"
1364
1365     triggers:
1366       - timed: "{obj:cron}"
1367
1368     builders:
1369       - lf-infra-pre-build
1370       - inject:
1371           properties-content: OS_CLOUD={openstack-cloud}
1372       # Stacks
1373       - conditional-step:
1374           condition-kind: boolean-expression
1375           condition-expression: "{openstack-stack-cleanup}"
1376           steps:
1377             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-stacks.sh
1378       # Servers
1379       - conditional-step:
1380           condition-kind: boolean-expression
1381           condition-expression: "{openstack-server-cleanup}"
1382           steps:
1383             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-servers.sh
1384       # Ports
1385       - conditional-step:
1386           condition-kind: boolean-expression
1387           condition-expression: "{openstack-port-cleanup}"
1388           steps:
1389             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-ports.sh
1390       # Volumes
1391       - conditional-step:
1392           condition-kind: boolean-expression
1393           condition-expression: "{openstack-volume-cleanup}"
1394           steps:
1395             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-volumes.sh
1396       # Images
1397       - conditional-step:
1398           condition-kind: boolean-expression
1399           condition-expression: "{openstack-image-protect}"
1400           steps:
1401             - shell: !include-raw-escape: ../shell/openstack-protect-in-use-images.sh
1402       - conditional-step:
1403           condition-kind: boolean-expression
1404           condition-expression: "{openstack-image-cleanup}"
1405           steps:
1406             - inject:
1407                 properties-content: OS_IMAGE_CLEANUP_AGE={openstack-image-cleanup-age}
1408             - shell: !include-raw-escape: ../shell/openstack-cleanup-old-images.sh
1409
1410     publishers:
1411       - lf-infra-publish
1412
1413 - job-template:
1414     name: "{project-name}-openstack-cron"
1415     id: gerrit-openstack-cron
1416     <<: *lf_openstack_cron
1417
1418     scm:
1419       - lf-infra-gerrit-scm:
1420           git-url: "{git-url}"
1421           refspec: "refs/heads/{branch}"
1422           branch: "{branch}"
1423           submodule-recursive: true
1424           submodule-timeout: "{submodule-timeout}"
1425           submodule-disable: "{submodule-disable}"
1426           choosing-strategy: default
1427           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1428
1429 - job-template:
1430     name: "{project-name}-openstack-cron"
1431     id: github-openstack-cron
1432     <<: *lf_openstack_cron
1433
1434     scm:
1435       - lf-infra-github-scm:
1436           url: "{git-clone-url}{github-org}/{project}"
1437           refspec: ""
1438           branch: "refs/heads/{branch}"
1439           submodule-recursive: true
1440           submodule-timeout: "{submodule-timeout}"
1441           submodule-disable: "{submodule-disable}"
1442           choosing-strategy: default
1443           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1444
1445 ################
1446 # Packer Merge #
1447 ################
1448
1449 - lf_packer_merge: &lf_packer_merge
1450     name: lf-packer-merge
1451
1452     ######################
1453     # Default parameters #
1454     ######################
1455
1456     openstack: true
1457     openstack-cloud: vex
1458     update-cloud-image: false
1459
1460     #####################
1461     # Job Configuration #
1462     #####################
1463
1464     parameters:
1465       - lf-infra-parameters:
1466           project: "{project}"
1467           stream: "{stream}"
1468           branch: "{branch}"
1469       - lf-packer-parameters:
1470           packer-version: "{packer-version}"
1471       - bool:
1472           name: UPDATE_CLOUD_IMAGE
1473           default: "{update-cloud-image}"
1474           description: "Update new built image on the cloud."
1475
1476     builders:
1477       - lf-infra-packer-build:
1478           openstack: "{openstack}"
1479           openstack-cloud: "{openstack-cloud}"
1480           packer-cloud-settings: "{packer-cloud-settings}"
1481           packer-version: "{packer-version}"
1482           platform: "{platforms}"
1483           template: "{templates}"
1484           update-cloud-image: "{update-cloud-image}"
1485       - description-setter:
1486           regexp: '(\s+.*)(ZZCI\s+.*\d+-\d+\.\d+)'
1487           description: 'Image: \2'
1488       # - trigger-builds:
1489       #     - project: '{project-name}-openstack-update-cloud-image'
1490       #       block: false
1491       #       predefined-parameters: |
1492       #         GERRIT_BRANCH=$GERRIT_BRANCH
1493       #         GERRIT_PROJECT=$GERRIT_PROJECT
1494       #         GERRIT_REFSPEC=$GERRIT_REFSPEC
1495       #         NEW_IMAGE_NAME=$NEW_IMAGE_NAME
1496       #       property-file: variables.jenkins-trigger
1497       #       property-file-fail-on-missing: true
1498
1499     publishers:
1500       - lf-infra-publish
1501       - trigger-parameterized-builds:
1502           - project: "{project-name}-openstack-update-cloud-image"
1503             condition: UNSTABLE_OR_BETTER
1504             predefined-parameters: |
1505               NEW_IMAGE_NAME=$NEW_IMAGE_NAME
1506             property-file: variables.jenkins-trigger
1507             fail-on-missing: true
1508
1509 - job-template:
1510     name: "{project-name}-packer-merge-{platforms}-{templates}"
1511     id: gerrit-packer-merge
1512     <<: *lf_packer_common
1513     # yamllint disable-line rule:key-duplicates
1514     <<: *lf_packer_merge
1515
1516     ######################
1517     # Default parameters #
1518     ######################
1519
1520     git-url: "$GIT_URL/$GERRIT_PROJECT"
1521
1522     gerrit_merge_triggers:
1523       - change-merged-event
1524       - comment-added-contains-event:
1525           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
1526
1527     #####################
1528     # Job Configuration #
1529     #####################
1530
1531     scm:
1532       - lf-infra-gerrit-scm:
1533           git-url: "{git-url}"
1534           refspec: "$GERRIT_REFSPEC"
1535           branch: "$GERRIT_BRANCH"
1536           submodule-recursive: "{submodule-recursive}"
1537           submodule-timeout: "{submodule-timeout}"
1538           submodule-disable: "{submodule-disable}"
1539           choosing-strategy: default
1540           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1541
1542     triggers:
1543       - timed: "{obj:cron}"
1544       - gerrit:
1545           server-name: "{gerrit-server-name}"
1546           trigger-on: "{obj:gerrit_merge_triggers}"
1547           projects:
1548             - project-compare-type: ANT
1549               project-pattern: "{project}"
1550               branches:
1551                 - branch-compare-type: ANT
1552                   branch-pattern: "**/{branch}"
1553               file-paths:
1554                 - compare-type: REG_EXP
1555                   pattern: 'packer\/provision\/.*\.sh'
1556                 - compare-type: REG_EXP
1557                   pattern: 'packer\/provision\/.*\.bat'
1558                 - compare-type: REG_EXP
1559                   pattern: 'packer\/provision\/.*\.ps1'
1560                 - compare-type: REG_EXP
1561                   pattern: 'packer\/provision\/{templates}\.yaml'
1562                 - compare-type: REG_EXP
1563                   pattern: 'packer\/provision\/local-{templates}\.yaml'
1564                 - compare-type: REG_EXP
1565                   pattern: 'packer\/templates\/{templates}\.json'
1566                 - compare-type: REG_EXP
1567                   pattern: 'packer\/vars\/{platforms}\.json'
1568
1569 - job-template:
1570     name: "{project-name}-packer-merge-{platforms}-{templates}"
1571     id: github-packer-merge
1572     <<: *lf_packer_common
1573     # yamllint disable-line rule:key-duplicates
1574     <<: *lf_packer_merge
1575
1576     #####################
1577     # Job Configuration #
1578     #####################
1579
1580     properties:
1581       - lf-infra-properties:
1582           project: "{project}"
1583           build-days-to-keep: 7
1584       - github:
1585           url: "{github-url}/{github-org}/{project}"
1586
1587     scm:
1588       - lf-infra-github-scm:
1589           url: "{git-clone-url}{github-org}/{project}"
1590           refspec: >
1591             +refs/heads/*:refs/remotes/origin/*
1592             +refs/pull/*:refs/remotes/origin/pr/*
1593           branch: "$GERRIT_REFSPEC"
1594           submodule-recursive: "{submodule-recursive}"
1595           submodule-timeout: "{submodule-timeout}"
1596           submodule-disable: "{submodule-disable}"
1597           choosing-strategy: default
1598           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1599
1600     triggers:
1601       - timed: "{obj:cron}"
1602       - github
1603       - pollscm:
1604           cron: ""
1605
1606       - github-pull-request:
1607           trigger-phrase: "^remerge$"
1608           only-trigger-phrase: true
1609           status-context: "Packer {platforms}-{templates} Merge"
1610           permit-all: true
1611           github-hooks: true
1612           org-list:
1613             - "{github-org}"
1614           white-list: "{obj:github_pr_whitelist}"
1615           admin-list: "{obj:github_pr_admin_list}"
1616           # included-regions MUST match Gerrit Trigger file-paths
1617           included-regions:
1618             - 'packer\/provision\/.*\.sh'
1619             - 'packer\/provision\/.*\.bat'
1620             - 'packer\/provision\/.*\.ps1'
1621             - 'packer\/provision\/{templates}\.yaml'
1622             - 'packer\/provision\/local-{templates}\.yaml'
1623             - 'packer\/templates\/{templates}\.json'
1624             - 'packer\/vars\/{platforms}\.json'
1625           white-list-target-branches:
1626             - "{branch}"
1627
1628 - job-template:
1629     name: "{project-name}-packer-verify-build-{platforms}-{templates}"
1630     id: gerrit-packer-verify-build
1631     <<: *lf_packer_common
1632     # yamllint disable-line rule:key-duplicates
1633     <<: *lf_packer_merge
1634
1635     ######################
1636     # Default parameters #
1637     ######################
1638
1639     git-url: "$GIT_URL/$GERRIT_PROJECT"
1640
1641     gerrit_verify_triggers:
1642       - comment-added-contains-event:
1643           comment-contains-value: '^Patch Set\s+\d+:\s+(verify-build|packer-build)\s*$'
1644
1645     #####################
1646     # Job Configuration #
1647     #####################
1648
1649     scm:
1650       - lf-infra-gerrit-scm:
1651           git-url: "{git-url}"
1652           refspec: "$GERRIT_REFSPEC"
1653           branch: "$GERRIT_BRANCH"
1654           submodule-recursive: "{submodule-recursive}"
1655           submodule-timeout: "{submodule-timeout}"
1656           submodule-disable: "{submodule-disable}"
1657           choosing-strategy: gerrit
1658           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1659
1660     triggers:
1661       - gerrit:
1662           server-name: "{gerrit-server-name}"
1663           trigger-on: "{obj:gerrit_verify_triggers}"
1664           projects:
1665             - project-compare-type: ANT
1666               project-pattern: "{project}"
1667               branches:
1668                 - branch-compare-type: ANT
1669                   branch-pattern: "**/{branch}"
1670               file-paths:
1671                 - compare-type: REG_EXP
1672                   pattern: 'packer\/provision\/.*\.sh'
1673                 - compare-type: REG_EXP
1674                   pattern: 'packer\/provision\/.*\.bat'
1675                 - compare-type: REG_EXP
1676                   pattern: 'packer\/provision\/.*\.ps1'
1677                 - compare-type: REG_EXP
1678                   pattern: 'packer\/provision\/{templates}\.yaml'
1679                 - compare-type: REG_EXP
1680                   pattern: 'packer\/provision\/local-{templates}\.yaml'
1681                 - compare-type: REG_EXP
1682                   pattern: 'packer\/templates\/{templates}\.json'
1683                 - compare-type: REG_EXP
1684                   pattern: 'packer\/vars\/{platforms}\.json'
1685
1686 - job-template:
1687     name: "{project-name}-packer-verify-build-{platforms}-{templates}"
1688     id: github-packer-verify-build
1689     <<: *lf_packer_common
1690     # yamllint disable-line rule:key-duplicates
1691     <<: *lf_packer_merge
1692
1693     #####################
1694     # Job Configuration #
1695     #####################
1696
1697     properties:
1698       - lf-infra-properties:
1699           project: "{project}"
1700           build-days-to-keep: 7
1701       - github:
1702           url: "{github-url}/{github-org}/{project}"
1703
1704     scm:
1705       - lf-infra-github-scm:
1706           url: "{git-clone-url}{github-org}/{project}"
1707           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1708           branch: "$sha1"
1709           submodule-recursive: "{submodule-recursive}"
1710           submodule-timeout: "{submodule-timeout}"
1711           submodule-disable: "{submodule-disable}"
1712           choosing-strategy: default
1713           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1714
1715     triggers:
1716       - github-pull-request:
1717           trigger-phrase: "^(verify-build|packer-build)$"
1718           only-trigger-phrase: true
1719           status-context: "Packer {platforms}-{templates} Verify Build"
1720           permit-all: true
1721           github-hooks: true
1722           white-list-target-branches:
1723             - "{branch}"
1724           # included-regions MUST match Gerrit Trigger file-paths
1725           included-regions:
1726             - 'packer\/provision\/.*\.sh'
1727             - 'packer\/provision\/.*\.bat'
1728             - 'packer\/provision\/.*\.ps1'
1729             - 'packer\/provision\/{templates}\.yaml'
1730             - 'packer\/provision\/local-{templates}\.yaml'
1731             - 'packer\/templates\/{templates}\.json'
1732             - 'packer\/vars\/{platforms}\.json'
1733
1734 #################
1735 # Packer Verify #
1736 #################
1737
1738 - lf_packer_verify: &lf_packer_verify
1739     name: lf-packer-verify
1740
1741     ######################
1742     # Default parameters #
1743     ######################
1744
1745     build-timeout: 10
1746     openstack: true
1747     openstack-cloud: vex
1748
1749     gerrit_verify_triggers:
1750       - patchset-created-event:
1751           exclude-drafts: true
1752           exclude-trivial-rebase: false
1753           exclude-no-code-change: false
1754       - draft-published-event
1755       - comment-added-contains-event:
1756           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1757
1758     gerrit_trigger_file_paths:
1759       - compare-type: REG_EXP
1760         pattern: 'packer\/.*'
1761
1762     # github_included_regions MUST match gerrit_trigger_file_paths
1763     github_included_regions:
1764       - 'packer\/.*'
1765
1766     #####################
1767     # Job Configuration #
1768     #####################
1769
1770     concurrent: true
1771
1772     builders:
1773       - lf-infra-packer-validate:
1774           openstack: "{openstack}"
1775           openstack-cloud: "{openstack-cloud}"
1776           packer-cloud-settings: "{packer-cloud-settings}"
1777           packer-version: "{packer-version}"
1778
1779 - job-template:
1780     name: "{project-name}-packer-verify"
1781     id: gerrit-packer-verify
1782     <<: *lf_packer_common
1783     # yamllint disable-line rule:key-duplicates
1784     <<: *lf_packer_verify
1785
1786     ######################
1787     # Default parameters #
1788     ######################
1789
1790     git-url: "$GIT_URL/$GERRIT_PROJECT"
1791
1792     #####################
1793     # Job Configuration #
1794     #####################
1795
1796     scm:
1797       - lf-infra-gerrit-scm:
1798           git-url: "{git-url}"
1799           refspec: "$GERRIT_REFSPEC"
1800           branch: "$GERRIT_BRANCH"
1801           submodule-recursive: "{submodule-recursive}"
1802           submodule-timeout: "{submodule-timeout}"
1803           submodule-disable: "{submodule-disable}"
1804           choosing-strategy: gerrit
1805           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1806
1807     triggers:
1808       - gerrit:
1809           server-name: "{gerrit-server-name}"
1810           trigger-on: "{obj:gerrit_verify_triggers}"
1811           projects:
1812             - project-compare-type: ANT
1813               project-pattern: "{project}"
1814               branches:
1815                 - branch-compare-type: ANT
1816                   branch-pattern: "**/{branch}"
1817               file-paths: "{obj:gerrit_trigger_file_paths}"
1818
1819 - job-template:
1820     name: "{project-name}-packer-verify"
1821     id: github-packer-verify
1822     <<: *lf_packer_common
1823     # yamllint disable-line rule:key-duplicates
1824     <<: *lf_packer_verify
1825
1826     #####################
1827     # Job Configuration #
1828     #####################
1829
1830     properties:
1831       - lf-infra-properties:
1832           project: "{project}"
1833           build-days-to-keep: 7
1834       - github:
1835           url: "{github-url}/{github-org}/{project}"
1836
1837     scm:
1838       - lf-infra-github-scm:
1839           url: "{git-clone-url}{github-org}/{project}"
1840           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1841           branch: "$sha1"
1842           submodule-recursive: "{submodule-recursive}"
1843           submodule-timeout: "{submodule-timeout}"
1844           submodule-disable: "{submodule-disable}"
1845           choosing-strategy: default
1846           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1847
1848     triggers:
1849       - github-pull-request:
1850           trigger-phrase: "^(recheck|reverify)$"
1851           only-trigger-phrase: false
1852           status-context: "Packer Verify"
1853           permit-all: true
1854           github-hooks: true
1855           included-regions: "{obj:github_included_regions}"
1856           white-list-target-branches:
1857             - "{branch}"
1858
1859 ################################
1860 # Openstack Update Cloud Image #
1861 ################################
1862
1863 - lf_openstack_cron: &lf_openstack_update_cloud_image
1864     name: lf-openstack-update-cloud-image
1865
1866     ######################
1867     # Default parameters #
1868     ######################
1869
1870     branch: master
1871     build-days-to-keep: 7
1872     build-timeout: 10
1873     cron: "@monthly"
1874     disable-job: false
1875     git-url: "$GIT_URL/$PROJECT"
1876     github-url: "https://github.com"
1877     new-image-name: "all"
1878     openstack-cloud: vex
1879     stream: master
1880     submodule-timeout: 10
1881     submodule-disable: false
1882     update-cloud-image: false
1883
1884     #####################
1885     # Job Configuration #
1886     #####################
1887
1888     project-type: freestyle
1889     node: "{build-node}"
1890     concurrent: false
1891     disabled: "{disable-job}"
1892
1893     properties:
1894       - lf-infra-properties:
1895           build-days-to-keep: "{build-days-to-keep}"
1896
1897     parameters:
1898       - lf-infra-parameters:
1899           project: "{project}"
1900           stream: "{stream}"
1901           branch: "{branch}"
1902       - string:
1903           name: NEW_IMAGE_NAME
1904           default: "{new-image-name}"
1905           description: "Name of cloud image to update in Jenkins"
1906
1907     wrappers:
1908       - lf-infra-wrappers:
1909           build-timeout: "{build-timeout}"
1910           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1911       # Listed after to override openstack-infra-wrappers clouds.yaml definition
1912       - config-file-provider:
1913           files:
1914             - file-id: clouds-yaml
1915               target: "$HOME/.config/openstack/clouds.yaml"
1916             - file-id: npmrc
1917               target: "$HOME/.npmrc"
1918             - file-id: pipconf
1919               target: "$HOME/.config/pip/pip.conf"
1920
1921     builders:
1922       - lf-infra-pre-build
1923       - inject:
1924           properties-content: |
1925             OS_CLOUD={openstack-cloud}
1926       - shell: |
1927           #!/bin/bash
1928           echo "Extract the image type for commit message"
1929           # echo IMAGE_TYPE=${{NEW_IMAGE_NAME% -*}} >> image-type.txt
1930           IMAGE_TYPE=$(echo ${{NEW_IMAGE_NAME}} | tr -d "\'\"\ " | awk -F- '{{ print $2 " " $3 " " $4 }}')
1931           echo IMAGE_TYPE=${{IMAGE_TYPE}} >> image-type.txt
1932           cat image-type.txt
1933       - inject:
1934           properties-file: "image-type.txt"
1935       - lf-infra-update-packer-images
1936       - lf-infra-push-gerrit-patch:
1937           project: "{project}"
1938           gerrit-user: "{gerrit-user}"
1939           gerrit-host: "{gerrit-host}"
1940           gerrit-topic: "{gerrit-topic}"
1941           gerrit-commit-message: "Update cloud image $IMAGE_TYPE"
1942           reviewers-email: "{reviewers-email}"
1943
1944     publishers:
1945       - lf-infra-publish
1946
1947 - job-template:
1948     name: "{project-name}-openstack-update-cloud-image"
1949     id: gerrit-openstack-update-cloud-image
1950     <<: *lf_openstack_update_cloud_image
1951
1952     ######################
1953     # Default parameters #
1954     ######################
1955
1956     git-url: "$GIT_URL/$GERRIT_PROJECT"
1957
1958     #####################
1959     # Job Configuration #
1960     #####################
1961
1962     scm:
1963       - lf-infra-gerrit-scm:
1964           git-url: "{git-url}"
1965           refspec: "$GERRIT_REFSPEC"
1966           branch: "$GERRIT_BRANCH"
1967           submodule-recursive: false
1968           submodule-timeout: "{submodule-timeout}"
1969           submodule-disable: "{submodule-disable}"
1970           choosing-strategy: gerrit
1971           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1972
1973     triggers:
1974       - timed: "{obj:cron}"
1975
1976 #################
1977 # Puppet Verify #
1978 #################
1979
1980 - lf_puppet_verify: &lf_puppet_verify
1981     name: lf-puppet-verify
1982
1983     ######################
1984     # Default parameters #
1985     ######################
1986
1987     branch: master
1988     build-days-to-keep: 7
1989     build-timeout: 15
1990     disable-job: false
1991     git-url: "$GIT_URL/$GERRIT_PROJECT"
1992     github-url: "https://github.com"
1993     parallel: true
1994     puppet-dir: ""
1995     puppet-lint-version: 2.3.6
1996     stream: master
1997     submodule-recursive: true
1998     submodule-timeout: 10
1999     submodule-disable: false
2000
2001     gerrit_trigger_file_paths:
2002       - compare-type: REG_EXP
2003         pattern: ".*"
2004
2005     # github_included_regions MUST match gerrit_trigger_file_paths
2006     github_included_regions:
2007       - ".*"
2008
2009     #####################
2010     # Job Configuration #
2011     #####################
2012
2013     project-type: freestyle
2014     node: "{build-node}"
2015     concurrent: true
2016     disabled: "{disable-job}"
2017
2018     properties:
2019       - lf-infra-properties:
2020           build-days-to-keep: "{build-days-to-keep}"
2021
2022     parameters:
2023       - lf-infra-parameters:
2024           project: "{project}"
2025           branch: "{branch}"
2026           stream: "{stream}"
2027       - lf-puppet-parameters:
2028           puppet-lint-version: "{puppet-lint-version}"
2029
2030     wrappers:
2031       - lf-infra-wrappers:
2032           build-timeout: "{build-timeout}"
2033           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2034
2035     builders:
2036       - shell: !include-raw-escape: ../shell/puppet-lint.sh
2037
2038     publishers:
2039       - lf-infra-publish
2040
2041 - job-template:
2042     name: "{project-name}-puppet-verify"
2043     id: gerrit-puppet-verify
2044     <<: *lf_puppet_verify
2045
2046     ######################
2047     # Default parameters #
2048     ######################
2049
2050     gerrit_verify_triggers:
2051       - patchset-created-event:
2052           exclude-drafts: true
2053           exclude-trivial-rebase: false
2054           exclude-no-code-change: false
2055       - draft-published-event
2056       - comment-added-contains-event:
2057           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
2058
2059     #####################
2060     # Job Configuration #
2061     #####################
2062
2063     scm:
2064       - lf-infra-gerrit-scm:
2065           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2066           git-url: "{git-url}"
2067           refspec: "$GERRIT_REFSPEC"
2068           branch: "$GERRIT_BRANCH"
2069           submodule-recursive: "{submodule-recursive}"
2070           submodule-timeout: "{submodule-timeout}"
2071           submodule-disable: "{submodule-disable}"
2072           choosing-strategy: gerrit
2073
2074     triggers:
2075       - gerrit:
2076           server-name: "{gerrit-server-name}"
2077           trigger-on: "{obj:gerrit_verify_triggers}"
2078           projects:
2079             - project-compare-type: ANT
2080               project-pattern: "{project}"
2081               branches:
2082                 - branch-compare-type: ANT
2083                   branch-pattern: "**/{branch}"
2084               file-paths: "{obj:gerrit_trigger_file_paths}"
2085
2086 - job-template:
2087     name: "{project-name}-puppet-verify"
2088     id: github-puppet-verify
2089     <<: *lf_puppet_verify
2090
2091     #####################
2092     # Job Configuration #
2093     #####################
2094
2095     properties:
2096       - lf-infra-properties:
2097           project: "{project}"
2098           build-days-to-keep: 7
2099       - github:
2100           url: "{github-url}/{github-org}/{project}"
2101
2102     scm:
2103       - lf-infra-github-scm:
2104           url: "{git-clone-url}{github-org}/{project}"
2105           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
2106           branch: "$sha1"
2107           submodule-recursive: "{submodule-recursive}"
2108           submodule-timeout: "{submodule-timeout}"
2109           submodule-disable: "{submodule-disable}"
2110           choosing-strategy: default
2111           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2112
2113     triggers:
2114       - github-pull-request:
2115           trigger-phrase: "^(recheck|reverify)$"
2116           only-trigger-phrase: false
2117           status-context: "Puppet Verify"
2118           permit-all: true
2119           github-hooks: true
2120           included-regions: "{obj:github_included_regions}"
2121           white-list-target-branches:
2122             - "{branch}"
2123
2124 #########
2125 # Sonar #
2126 #########
2127
2128 - lf_sonar_common: &lf_sonar_common
2129     name: lf-sonar-common
2130
2131     ######################
2132     # Default parameters #
2133     ######################
2134
2135     archive-artifacts: >
2136       **/*.log
2137
2138     branch: master # Sonar should always be run on master branch
2139     build-days-to-keep: 7
2140     build-timeout: 60
2141     cron: "H H * * *" # run daily
2142     disable-job: false
2143     git-url: "$GIT_URL/$PROJECT"
2144     github-url: "https://github.com"
2145     stream: master
2146     submodule-recursive: true
2147     submodule-timeout: 10
2148     submodule-disable: false
2149
2150     # Sonar properties
2151     sonar-task: ""
2152     sonar-project-file: "sonar-project.properties"
2153     sonar-properties: ""
2154     sonar-java-opts: ""
2155     sonar-additional-args: ""
2156
2157     gerrit_trigger_file_paths:
2158       - compare-type: REG_EXP
2159         pattern: ".*"
2160
2161     # github_included_regions MUST match gerrit_trigger_file_paths
2162     github_included_regions:
2163       - ".*"
2164
2165     #####################
2166     # Job Configuration #
2167     #####################
2168
2169     project-type: freestyle
2170     node: "{build-node}"
2171
2172     properties:
2173       - lf-infra-properties:
2174           build-days-to-keep: "{build-days-to-keep}"
2175
2176     wrappers:
2177       - lf-infra-wrappers:
2178           build-timeout: "{build-timeout}"
2179           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2180
2181     disabled: "{disable-job}"
2182
2183     parameters:
2184       - lf-infra-parameters:
2185           project: "{project}"
2186           branch: "{branch}"
2187           stream: "{stream}"
2188       - string:
2189           name: ARCHIVE_ARTIFACTS
2190           default: "{archive-artifacts}"
2191           description: Artifacts to archive to the logs server.
2192
2193     publishers:
2194       - lf-infra-publish
2195
2196 - lf_sonar_builders: &lf_sonar_builders
2197     name: lf-sonar-builders
2198     builders:
2199       - lf-infra-pre-build
2200       - lf-infra-sonar:
2201           sonar-task: "{sonar-task}"
2202           sonar-project-file: "{sonar-project-file}"
2203           sonar-properties: "{sonar-properties}"
2204           sonar-java-opts: "{sonar-java-opts}"
2205           sonar-additional-args: "{sonar-additional-args}"
2206
2207 - lf_sonar_builders_prescan: &lf_sonar_builders_prescan
2208     name: lf-sonar-builders-prescan
2209     builders:
2210       - lf-infra-pre-build
2211       - lf-infra-sonar-with-prescan:
2212           sonar-task: "{sonar-task}"
2213           sonar-project-file: "{sonar-project-file}"
2214           sonar-properties: "{sonar-properties}"
2215           sonar-java-opts: "{sonar-java-opts}"
2216           sonar-additional-args: "{sonar-additional-args}"
2217
2218 - lf_sonar_builders_prescan_script: &lf_sonar_builders_prescan_script
2219     name: lf-sonar-builders-prescan-script
2220     builders:
2221       - lf-infra-pre-build
2222       - shell: "{sonar-prescan-script}"
2223       - lf-infra-sonar:
2224           sonar-task: "{sonar-task}"
2225           sonar-project-file: "{sonar-project-file}"
2226           sonar-properties: "{sonar-properties}"
2227           sonar-java-opts: "{sonar-java-opts}"
2228           sonar-additional-args: "{sonar-additional-args}"
2229
2230 - lf_sonar_gerrit_common: &lf_sonar_gerrit_common
2231     name: lf-sonar-gerrit-common
2232     gerrit_sonar_triggers:
2233       - comment-added-contains-event:
2234           comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
2235
2236     scm:
2237       - lf-infra-gerrit-scm:
2238           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2239           git-url: "{git-url}"
2240           refspec: $GERRIT_REFSPEC
2241           branch: $GERRIT_BRANCH
2242           submodule-recursive: "{submodule-recursive}"
2243           submodule-timeout: "{submodule-timeout}"
2244           submodule-disable: "{submodule-disable}"
2245           choosing-strategy: default
2246
2247     triggers:
2248       - timed: "{obj:cron}"
2249       - gerrit:
2250           server-name: "{gerrit-server-name}"
2251           trigger-on: "{obj:gerrit_sonar_triggers}"
2252           projects:
2253             - project-compare-type: "ANT"
2254               project-pattern: "{project}"
2255               branches:
2256                 - branch-compare-type: "ANT"
2257                   branch-pattern: "**/{branch}"
2258               file-paths: "{obj:gerrit_trigger_file_paths}"
2259           skip-vote:
2260             successful: true
2261             failed: true
2262             unstable: true
2263             notbuilt: true
2264
2265 - lf_sonar_github_common: &lf_sonar_github_common
2266     name: lf-sonar-github-common
2267     properties:
2268       - lf-infra-properties:
2269           build-days-to-keep: "{build-days-to-keep}"
2270       - github:
2271           url: "{github-url}/{github-org}/{project}"
2272
2273     scm:
2274       - lf-infra-github-scm:
2275           url: "{git-clone-url}{github-org}/{project}"
2276           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
2277           branch: "$sha1"
2278           submodule-recursive: "{submodule-recursive}"
2279           submodule-timeout: "{submodule-timeout}"
2280           submodule-disable: "{submodule-disable}"
2281           choosing-strategy: default
2282           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2283
2284     triggers:
2285       - github-pull-request:
2286           trigger-phrase: "^run-sonar$"
2287           only-trigger-phrase: false
2288           status-context: "Python Sonar"
2289           permit-all: true
2290           github-hooks: true
2291           white-list-target-branches:
2292             - "{branch}"
2293           included-regions: "{obj:github_included_regions}"
2294
2295 - job-template:
2296     name: "{project-name}-sonar"
2297     id: gerrit-sonar
2298     <<: *lf_sonar_common
2299     # yamllint disable-line rule:key-duplicates
2300     <<: *lf_sonar_builders
2301     # yamllint disable-line rule:key-duplicates
2302     <<: *lf_sonar_gerrit_common
2303
2304 - job-template:
2305     name: "{project-name}-sonar"
2306     id: github-sonar
2307     <<: *lf_sonar_common
2308     # yamllint disable-line rule:key-duplicates
2309     <<: *lf_sonar_builders
2310     # yamllint disable-line rule:key-duplicates
2311     <<: *lf_sonar_github_common
2312
2313 - job-template:
2314     name: "{project-name}-sonar-prescan"
2315     id: gerrit-sonar-prescan
2316     <<: *lf_sonar_common
2317     # yamllint disable-line rule:key-duplicates
2318     <<: *lf_sonar_builders_prescan
2319     # yamllint disable-line rule:key-duplicates
2320     <<: *lf_sonar_gerrit_common
2321
2322 - job-template:
2323     name: "{project-name}-sonar-prescan"
2324     id: github-sonar-prescan
2325     <<: *lf_sonar_common
2326     # yamllint disable-line rule:key-duplicates
2327     <<: *lf_sonar_builders_prescan
2328     # yamllint disable-line rule:key-duplicates
2329     <<: *lf_sonar_github_common
2330
2331 - job-template:
2332     name: "{project-name}-sonar-prescan-script"
2333     id: gerrit-sonar-prescan-script
2334     <<: *lf_sonar_common
2335     # yamllint disable-line rule:key-duplicates
2336     <<: *lf_sonar_builders_prescan_script
2337     # yamllint disable-line rule:key-duplicates
2338     <<: *lf_sonar_gerrit_common
2339
2340 - job-template:
2341     name: "{project-name}-sonar-prescan-script"
2342     id: github-sonar-prescan-script
2343     <<: *lf_sonar_common
2344     # yamllint disable-line rule:key-duplicates
2345     <<: *lf_sonar_builders_prescan_script
2346     # yamllint disable-line rule:key-duplicates
2347     <<: *lf_sonar_github_common
2348
2349 #############
2350 # Pipelines #
2351 #############
2352
2353 - lf_pipelines_common: &lf_pipelines_common
2354     name: lf-pipelines-common
2355
2356     ######################
2357     # Default parameters #
2358     ######################
2359
2360     branch: master
2361     build-timeout: 90
2362     disable-job: false
2363     stream: master
2364     submodule-recursive: true
2365     submodule-timeout: 10
2366     submodule-disable: false
2367
2368 - lf_global_pipelines_common: &lf_global_pipelines_common
2369     name: lf-global-pipelines-common
2370
2371     # All jobs are triggering from the same source
2372     git-url: https://gerrit.linuxfoundation.org/infra/releng/pipelines
2373     triggers:
2374       - gerrit:
2375           server-name: "lf-releng"
2376           trigger-on:
2377             - patchset-created-event:
2378                 exclude-drafts: true
2379                 exclude-trivial-rebase: false
2380                 exclude-no-code-change: false
2381             - draft-published-event
2382             - comment-added-contains-event:
2383                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
2384           projects:
2385             - project-compare-type: ANT
2386               project-pattern: "releng/pipelines"
2387               branches:
2388                 - branch-compare-type: ANT
2389                   branch-pattern: "**/master"
2390
2391 - job-template:
2392     name: "lf-pipelines-verify"
2393     id: lf-pipelines-verify
2394     <<: *lf_pipelines_common
2395     <<: *lf_global_pipelines_common
2396
2397     project-type: pipeline
2398     pipeline-scm:
2399       scm:
2400         - lf-infra-gerrit-scm:
2401             git-url: "{git-url}"
2402             refspec: "$GERRIT_REFSPEC"
2403             branch: "$GERRIT_BRANCH"
2404             submodule-recursive: "{submodule-recursive}"
2405             submodule-timeout: "{submodule-timeout}"
2406             submodule-disable: "{submodule-disable}"
2407             choosing-strategy: gerrit
2408             jenkins-ssh-credential: "{jenkins-ssh-credential}"
2409     sandbox: true