Improve upstream gjjb jobs, add Github version
[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
627     wrappers:
628       - lf-infra-wrappers:
629           build-timeout: 5
630           jenkins-ssh-credential: "{jenkins-ssh-credential}"
631
632     builders:
633       - lf-infra-jjbini
634       - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
635
636     publishers:
637       - lf-infra-publish
638
639 - job-template:
640     name: "{project-name}-jjb-deploy-job"
641     id: gerrit-jjb-deploy-job
642     <<: *lf_jjb_deploy_job
643
644     scm:
645       - lf-infra-gerrit-scm:
646           git-url: "{git-url}"
647           refspec: "refs/heads/{branch}"
648           branch: "{branch}"
649           submodule-recursive: true
650           submodule-timeout: "{submodule-timeout}"
651           submodule-disable: "{submodule-disable}"
652           choosing-strategy: default
653           jenkins-ssh-credential: "{jenkins-ssh-credential}"
654
655     triggers:
656       - gerrit:
657           server-name: "{gerrit-server-name}"
658           trigger-on: "{obj:gerrit_jjb_deploy_job_triggers}"
659           projects:
660             - project-compare-type: ANT
661               project-pattern: "**"
662               branches:
663                 - branch-compare-type: ANT
664                   branch-pattern: "**"
665           skip-vote:
666             success: true
667             failed: true
668             unstable: true
669             notbuilt: true
670
671 - job-template:
672     name: "{project-name}-jjb-deploy-job"
673     id: github-jjb-deploy-job
674     <<: *lf_jjb_deploy_job
675
676     properties:
677       - lf-infra-properties:
678           project: "{project}"
679           build-days-to-keep: 1
680       - github:
681           url: "{github-url}/{github-org}/{project}"
682
683     scm:
684       - lf-infra-github-scm:
685           url: "{git-clone-url}{github-org}/{project}"
686           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
687           branch: "$sha1"
688           submodule-recursive: true
689           submodule-timeout: "{submodule-timeout}"
690           submodule-disable: "{submodule-disable}"
691           choosing-strategy: default
692           jenkins-ssh-credential: "{jenkins-ssh-credential}"
693
694     triggers:
695       - github-pull-request:
696           trigger-phrase: '^jjb-deploy (?!\*+$).+$'
697           only-trigger-phrase: true
698           status-context: "JJB Deploy Job"
699           permit-all: true
700           github-hooks: true
701           white-list-target-branches:
702             - "{branch}"
703
704 #############
705 # JJB Merge #
706 #############
707
708 - lf_jjb_merge: &lf_jjb_merge
709     name: lf-jjb-merge
710
711     ######################
712     # Default parameters #
713     ######################
714
715     jjb-workers: 0
716
717     gerrit_merge_triggers:
718       - change-merged-event
719       - comment-added-contains-event:
720           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
721
722     #####################
723     # Job Configuration #
724     #####################
725
726     builders:
727       - lf-infra-pre-build
728       - lf-infra-jjbini
729       - inject:
730           properties-content: JJB_WORKERS={jjb-workers}
731       - shell: !include-raw-escape:
732           - ../shell/jjb-merge-job.sh
733
734 - job-template:
735     name: "{project-name}-jjb-merge"
736     id: gerrit-jjb-merge
737     <<: *lf_jjb_common
738     # yamllint disable-line rule:key-duplicates
739     <<: *lf_jjb_merge
740
741     git-url: "$GIT_URL/$GERRIT_PROJECT"
742
743     scm:
744       - lf-infra-gerrit-scm:
745           git-url: "{git-url}"
746           refspec: ""
747           branch: "{branch}"
748           submodule-recursive: "{submodule-recursive}"
749           submodule-timeout: "{submodule-timeout}"
750           submodule-disable: "{submodule-disable}"
751           choosing-strategy: default
752           jenkins-ssh-credential: "{jenkins-ssh-credential}"
753
754     triggers:
755       - gerrit:
756           server-name: "{gerrit-server-name}"
757           trigger-on: "{obj:gerrit_merge_triggers}"
758           projects:
759             - project-compare-type: ANT
760               project-pattern: "{project}"
761               branches:
762                 - branch-compare-type: ANT
763                   branch-pattern: "**/{branch}"
764               file-paths: "{obj:gerrit_trigger_file_paths}"
765
766 - job-template:
767     name: "{project-name}-jjb-merge"
768     id: github-jjb-merge
769     <<: *lf_jjb_common
770     # yamllint disable-line rule:key-duplicates
771     <<: *lf_jjb_merge
772
773     #####################
774     # Job Configuration #
775     #####################
776
777     properties:
778       - lf-infra-properties:
779           project: "{project}"
780           build-days-to-keep: 7
781       - github:
782           url: "{github-url}/{github-org}/{project}"
783
784     scm:
785       - lf-infra-github-scm:
786           url: "{git-clone-url}{github-org}/{project}"
787           refspec: ""
788           branch: "refs/heads/{branch}"
789           submodule-recursive: "{submodule-recursive}"
790           submodule-timeout: "{submodule-timeout}"
791           submodule-disable: "{submodule-disable}"
792           choosing-strategy: default
793           jenkins-ssh-credential: "{jenkins-ssh-credential}"
794
795     triggers:
796       - github
797       - pollscm:
798           cron: ""
799       - github-pull-request:
800           trigger-phrase: "^remerge$"
801           only-trigger-phrase: true
802           status-context: "JJB Merge"
803           permit-all: true
804           github-hooks: true
805           org-list:
806             - "{github-org}"
807           white-list: "{obj:github_pr_whitelist}"
808           admin-list: "{obj:github_pr_admin_list}"
809           included-regions: "{obj:github_included_regions}"
810           white-list-target-branches:
811             - "{branch}"
812
813 ##############
814 # JJB Verify #
815 ##############
816
817 - lf_jjb_verify: &lf_jjb_verify
818     name: lf-jjb-verify
819
820     ######################
821     # Default parameters #
822     ######################
823
824     build-concurrent: true
825     build-node-label-check: false
826     build-node-label-list: ""
827
828     gerrit_verify_triggers:
829       - patchset-created-event:
830           exclude-drafts: true
831           exclude-trivial-rebase: false
832           exclude-no-code-change: false
833       - draft-published-event
834       - comment-added-contains-event:
835           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
836
837     #####################
838     # Job Configuration #
839     #####################
840
841     concurrent: "{build-concurrent}"
842
843     builders:
844       - lf-infra-pre-build
845       - lf-infra-jjbini
846       - shell: !include-raw-escape:
847           - ../shell/jjb-verify-job.sh
848       - conditional-step:
849           condition-kind: boolean-expression
850           condition-expression: "{build-node-label-check}"
851           on-evaluation-failure: dont-run
852           steps:
853             - inject:
854                 properties-content: EXTERNAL_LABELS="{build-node-label-list}"
855             - shell: !include-raw-escape:
856                 - ../shell/jjb-verify-build-nodes.sh
857       - lf-infra-gpg-verify-git-signature
858
859 - job-template:
860     name: "{project-name}-jjb-verify"
861     id: gerrit-jjb-verify
862     <<: *lf_jjb_common
863     # yamllint disable-line rule:key-duplicates
864     <<: *lf_jjb_verify
865
866     ######################
867     # Default parameters #
868     ######################
869
870     git-url: "$GIT_URL/$GERRIT_PROJECT"
871
872     #####################
873     # Job Configuration #
874     #####################
875
876     scm:
877       - lf-infra-gerrit-scm:
878           git-url: "{git-url}"
879           refspec: "$GERRIT_REFSPEC"
880           branch: "$GERRIT_BRANCH"
881           submodule-recursive: "{submodule-recursive}"
882           submodule-timeout: "{submodule-timeout}"
883           submodule-disable: "{submodule-disable}"
884           choosing-strategy: gerrit
885           jenkins-ssh-credential: "{jenkins-ssh-credential}"
886
887     triggers:
888       - gerrit:
889           server-name: "{gerrit-server-name}"
890           trigger-on: "{obj:gerrit_verify_triggers}"
891           projects:
892             - project-compare-type: ANT
893               project-pattern: "{project}"
894               branches:
895                 - branch-compare-type: ANT
896                   branch-pattern: "**/{branch}"
897               file-paths: "{obj:gerrit_trigger_file_paths}"
898
899 - job-template:
900     name: "{project-name}-jjb-verify"
901     id: github-jjb-verify
902     <<: *lf_jjb_common
903     # yamllint disable-line rule:key-duplicates
904     <<: *lf_jjb_verify
905
906     #####################
907     # Job Configuration #
908     #####################
909
910     properties:
911       - lf-infra-properties:
912           project: "{project}"
913           build-days-to-keep: 7
914       - github:
915           url: "{github-url}/{github-org}/{project}"
916
917     scm:
918       - lf-infra-github-scm:
919           url: "{git-clone-url}{github-org}/{project}"
920           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
921           branch: "$sha1"
922           submodule-recursive: "{submodule-recursive}"
923           submodule-timeout: "{submodule-timeout}"
924           submodule-disable: "{submodule-disable}"
925           choosing-strategy: default
926           jenkins-ssh-credential: "{jenkins-ssh-credential}"
927
928     triggers:
929       - github-pull-request:
930           trigger-phrase: "^(recheck|reverify)$"
931           only-trigger-phrase: false
932           status-context: "JJB Verify"
933           permit-all: true
934           github-hooks: true
935           included-regions: "{obj:github_included_regions}"
936           white-list-target-branches:
937             - "{branch}"
938
939 ############################
940 # JJB Verify Upstream GJJB #
941 ############################
942
943 - lf_jjb_verify: &lf_jjb_verify_upstream_gjjb
944     name: lf-jjb-verify-upstream-gjjb
945
946     #####################
947     # Job Configuration #
948     #####################
949
950     concurrent: true
951
952     builders:
953       - shell: |
954           cd global-jjb
955           git fetch https://gerrit.linuxfoundation.org/infra/releng/global-jjb $GERRIT_REFSPEC
956           git cherry-pick FETCH_HEAD
957       - lf-infra-jjbini
958       - shell: !include-raw-escape:
959           - ../shell/jjb-verify-job.sh
960
961     # All jobs are triggering from the same source
962     triggers:
963       - gerrit:
964           server-name: "lf-releng"
965           trigger-on:
966             - patchset-created-event:
967                 exclude-drafts: true
968                 exclude-trivial-rebase: false
969                 exclude-no-code-change: false
970             - draft-published-event
971             - comment-added-contains-event:
972                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
973           projects:
974             - project-compare-type: ANT
975               project-pattern: "releng/global-jjb"
976               branches:
977                 - branch-compare-type: ANT
978                   branch-pattern: "**/master"
979           override-votes: true
980           gerrit-build-failed-codereview-value: -1
981           gerrit-build-failed-verified-value: 0
982           gerrit-build-successful-codereview-value: 1
983           gerrit-build-successful-verified-value: 0
984
985 - job-template:
986     name: "{project-name}-jjb-verify-upstream-gjjb"
987     id: gerrit-jjb-verify-upstream-gjjb
988     <<: *lf_jjb_common
989     # yamllint disable-line rule:key-duplicates
990     <<: *lf_jjb_verify_upstream_gjjb
991
992     ######################
993     # Default parameters #
994     ######################
995
996     git-url: "$GIT_URL/$PROJECT"
997     submodule-timeout: 10
998     submodule-disable: false
999
1000     #####################
1001     # Job Configuration #
1002     #####################
1003
1004     scm:
1005       - lf-infra-gerrit-scm:
1006           git-url: "{git-url}"
1007           refspec: ""
1008           branch: "master"
1009           submodule-recursive: true
1010           submodule-timeout: "{submodule-timeout}"
1011           submodule-disable: "{submodule-disable}"
1012           choosing-strategy: default
1013           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1014
1015 - job-template:
1016     name: "{project-name}-jjb-verify-upstream-gjjb"
1017     id: github-jjb-verify-upstream-gjjb
1018     <<: *lf_jjb_common
1019     # yamllint disable-line rule:key-duplicates
1020     <<: *lf_jjb_verify_upstream_gjjb
1021
1022     ######################
1023     # Default parameters #
1024     ######################
1025
1026     git-url: "$GIT_URL/$PROJECT"
1027     submodule-timeout: 10
1028     submodule-disable: false
1029
1030     #####################
1031     # Job Configuration #
1032     #####################
1033
1034     properties:
1035       - lf-infra-properties:
1036           project: "{project}"
1037           build-days-to-keep: 7
1038       - github:
1039           url: "{github-url}/{github-org}/{project}"
1040
1041     scm:
1042       - lf-infra-github-scm:
1043           url: "{git-clone-url}{github-org}/{project}"
1044           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1045           branch: "$sha1"
1046           submodule-recursive: "{submodule-recursive}"
1047           submodule-timeout: "{submodule-timeout}"
1048           submodule-disable: "{submodule-disable}"
1049           choosing-strategy: default
1050           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1051
1052 #################
1053 # License Check #
1054 #################
1055
1056 - lf_license_check: &lf_license_check
1057     name: lf-license-check
1058
1059     ######################
1060     # Default parameters #
1061     ######################
1062
1063     branch: master
1064     build-days-to-keep: 7
1065     build-timeout: 15
1066     disable-job: false
1067     file-patterns: >
1068       *.go
1069       *.groovy
1070       *.java
1071       *.py
1072       *.sh
1073     git-url: "$GIT_URL/$PROJECT"
1074     github-url: "https://github.com"
1075     lhc-version: 0.2.0
1076     license-exclude-paths: ""
1077     licenses-allowed: Apache-2.0,EPL-1.0,MIT
1078     project-pattern: "**"
1079     spdx-disable: false
1080     stream: master
1081     submodule-timeout: 10
1082     submodule-disable: false
1083
1084     #####################
1085     # Job Configuration #
1086     #####################
1087
1088     project-type: freestyle
1089     node: "{build-node}"
1090     concurrent: true
1091     disabled: "{disable-job}"
1092
1093     properties:
1094       - lf-infra-properties:
1095           build-days-to-keep: "{build-days-to-keep}"
1096
1097     parameters:
1098       - lf-infra-parameters:
1099           project: "{project}"
1100           branch: "{branch}"
1101           stream: "{stream}"
1102
1103     wrappers:
1104       - lf-infra-wrappers:
1105           build-timeout: "{build-timeout}"
1106           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1107
1108     builders:
1109       - lf-license-check:
1110           file-patterns: "{file-patterns}"
1111           spdx-disable: "{spdx-disable}"
1112           lhc-version: "{lhc-version}"
1113           license-exclude-paths: "{license-exclude-paths}"
1114           licenses-allowed: "{licenses-allowed}"
1115
1116     publishers:
1117       - lf-infra-publish
1118
1119 - job-template:
1120     name: "{project-name}-license-check"
1121     id: gerrit-license-check
1122     <<: *lf_license_check
1123
1124     git-url: "$GIT_URL/$GERRIT_PROJECT"
1125
1126     scm:
1127       - lf-infra-gerrit-scm:
1128           git-url: "{git-url}"
1129           refspec: "$GERRIT_REFSPEC"
1130           branch: "$GERRIT_BRANCH"
1131           # Submodules are out of the project's control
1132           submodule-recursive: false
1133           submodule-timeout: "{submodule-timeout}"
1134           submodule-disable: "{submodule-disable}"
1135           choosing-strategy: gerrit
1136           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1137
1138     triggers:
1139       - gerrit:
1140           server-name: "{gerrit-server-name}"
1141           # Trigger should not be overridable as we want to always run
1142           trigger-on:
1143             - patchset-created-event:
1144                 exclude-drafts: false
1145                 exclude-trivial-rebase: false
1146                 exclude-no-code-change: false
1147             - draft-published-event
1148             - comment-added-contains-event:
1149                 comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1150           projects:
1151             - project-compare-type: ANT
1152               project-pattern: "{project-pattern}"
1153               branches:
1154                 - branch-compare-type: ANT
1155                   branch-pattern: "**"
1156
1157 - job-template:
1158     name: "{project-name}-license-check"
1159     id: github-license-check
1160     <<: *lf_license_check
1161
1162     properties:
1163       - lf-infra-properties:
1164           build-days-to-keep: "{build-days-to-keep}"
1165       - github:
1166           url: "{github-url}/{github-org}/{project}"
1167
1168     scm:
1169       - lf-infra-github-scm:
1170           url: "{git-clone-url}{github-org}/{project}"
1171           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1172           branch: "$sha1"
1173           # Submodules are out of the project's control
1174           submodule-recursive: false
1175           submodule-timeout: "{submodule-timeout}"
1176           submodule-disable: "{submodule-disable}"
1177           choosing-strategy: default
1178           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1179
1180     triggers:
1181       - github-pull-request:
1182           trigger-phrase: "^recheck$"
1183           only-trigger-phrase: false
1184           status-context: "License Check"
1185           permit-all: true
1186           github-hooks: true
1187           white-list-target-branches:
1188             - "{branch}"
1189
1190 ####################
1191 # Info YAML Verify #
1192 ####################
1193
1194 - lf_info_yaml_verify: &lf_info_yaml_verify
1195     name: lf-info-yaml-verify
1196
1197     ######################
1198     # Default parameters #
1199     ######################
1200
1201     gerrit_verify_triggers:
1202       - patchset-created-event:
1203           exclude-drafts: true
1204           exclude-trivial-rebase: false
1205           exclude-no-code-change: false
1206       - draft-published-event
1207       - comment-added-contains-event:
1208           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1209
1210     #####################
1211     # Job Configuration #
1212     #####################
1213
1214     concurrent: true
1215
1216     builders:
1217       - shell: !include-raw-escape:
1218           - ../shell/git-validate-info-yaml.sh
1219           - ../shell/info-file-validate.sh
1220
1221 - job-template:
1222     name: "{project-name}-info-yaml-verify"
1223     id: gerrit-info-yaml-verify
1224     <<: *lf_jjb_common
1225     # yamllint disable-line rule:key-duplicates
1226     <<: *lf_info_yaml_verify
1227
1228     git-url: "$GIT_URL/$GERRIT_PROJECT"
1229
1230     scm:
1231       - lf-infra-gerrit-scm:
1232           git-url: "{git-url}"
1233           refspec: "$GERRIT_REFSPEC"
1234           branch: "$GERRIT_BRANCH"
1235           submodule-recursive: "{submodule-recursive}"
1236           submodule-timeout: "{submodule-timeout}"
1237           submodule-disable: "{submodule-disable}"
1238           choosing-strategy: gerrit
1239           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1240
1241     triggers:
1242       - gerrit:
1243           server-name: "{gerrit-server-name}"
1244           trigger-on: "{obj:gerrit_verify_triggers}"
1245           projects:
1246             - project-compare-type: ANT
1247               project-pattern: "{project}"
1248               branches:
1249                 - branch-compare-type: ANT
1250                   branch-pattern: "**/{branch}"
1251               file-paths:
1252                 - compare-type: REG_EXP
1253                   pattern: "INFO.yaml"
1254
1255 - job-template:
1256     name: "{project-name}-info-yaml-verify"
1257     id: github-info-yaml-verify
1258     <<: *lf_jjb_common
1259     # yamllint disable-line rule:key-duplicates
1260     <<: *lf_info_yaml_verify
1261
1262     github-url: "https://github.com"
1263     properties:
1264       - github:
1265           url: "{github-url}/{github-org}/{project}"
1266
1267     scm:
1268       - lf-infra-github-scm:
1269           url: "{git-clone-url}{github-org}/{project}"
1270           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1271           branch: "$sha1"
1272           submodule-recursive: "{submodule-recursive}"
1273           submodule-timeout: "{submodule-timeout}"
1274           submodule-disable: "{submodule-disable}"
1275           choosing-strategy: default
1276           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1277
1278     triggers:
1279       - github-pull-request:
1280           trigger-phrase: "^(recheck|reverify)$"
1281           only-trigger-phrase: false
1282           status-context: "INFO File Verify"
1283           permit-all: true
1284           github-hooks: true
1285           # included-regions MUST match gerrit file-paths
1286           included-regions: "INFO.yaml"
1287           white-list-target-branches:
1288             - "{branch}"
1289
1290 ##################
1291 # OPENSTACK CRON #
1292 ##################
1293
1294 - lf_openstack_cron: &lf_openstack_cron
1295     name: lf-openstack-cron
1296
1297     ######################
1298     # Default parameters #
1299     ######################
1300
1301     branch: master
1302     build-days-to-keep: 7
1303     build-timeout: 10
1304     cron: "@hourly"
1305     disable-job: false
1306     git-url: "$GIT_URL/$PROJECT"
1307     github-url: "https://github.com"
1308     openstack-cloud: vex
1309     openstack-image-cleanup: true
1310     openstack-image-cleanup-age: 30
1311     openstack-image-protect: true
1312     openstack-port-cleanup: true
1313     openstack-server-cleanup: true
1314     openstack-stack-cleanup: true
1315     openstack-volume-cleanup: true
1316     stream: master
1317     submodule-timeout: 10
1318     submodule-disable: false
1319
1320     #####################
1321     # Job Configuration #
1322     #####################
1323
1324     project-type: freestyle
1325     node: "{build-node}"
1326     concurrent: false
1327     disabled: "{disable-job}"
1328
1329     properties:
1330       - lf-infra-properties:
1331           build-days-to-keep: "{build-days-to-keep}"
1332
1333     parameters:
1334       - lf-infra-parameters:
1335           project: "{project}"
1336           stream: "{stream}"
1337           branch: "{branch}"
1338       - string:
1339           name: JENKINS_URLS
1340           default: "{jenkins-urls}"
1341           description: |
1342             Space separated list of Jenkins URLs to check for active builds.
1343
1344     wrappers:
1345       - lf-infra-wrappers:
1346           build-timeout: "{build-timeout}"
1347           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1348       # Listed after to override openstack-infra-wrappers clouds.yaml definition
1349       - config-file-provider:
1350           files:
1351             - file-id: clouds-yaml
1352               target: "$HOME/.config/openstack/clouds.yaml"
1353             - file-id: npmrc
1354               target: "$HOME/.npmrc"
1355             - file-id: pipconf
1356               target: "$HOME/.config/pip/pip.conf"
1357
1358     triggers:
1359       - timed: "{obj:cron}"
1360
1361     builders:
1362       - lf-infra-pre-build
1363       - inject:
1364           properties-content: OS_CLOUD={openstack-cloud}
1365       # Stacks
1366       - conditional-step:
1367           condition-kind: boolean-expression
1368           condition-expression: "{openstack-stack-cleanup}"
1369           steps:
1370             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-stacks.sh
1371       # Servers
1372       - conditional-step:
1373           condition-kind: boolean-expression
1374           condition-expression: "{openstack-server-cleanup}"
1375           steps:
1376             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-servers.sh
1377       # Ports
1378       - conditional-step:
1379           condition-kind: boolean-expression
1380           condition-expression: "{openstack-port-cleanup}"
1381           steps:
1382             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-ports.sh
1383       # Volumes
1384       - conditional-step:
1385           condition-kind: boolean-expression
1386           condition-expression: "{openstack-volume-cleanup}"
1387           steps:
1388             - shell: !include-raw-escape: ../shell/openstack-cleanup-orphaned-volumes.sh
1389       # Images
1390       - conditional-step:
1391           condition-kind: boolean-expression
1392           condition-expression: "{openstack-image-protect}"
1393           steps:
1394             - shell: !include-raw-escape: ../shell/openstack-protect-in-use-images.sh
1395       - conditional-step:
1396           condition-kind: boolean-expression
1397           condition-expression: "{openstack-image-cleanup}"
1398           steps:
1399             - inject:
1400                 properties-content: OS_IMAGE_CLEANUP_AGE={openstack-image-cleanup-age}
1401             - shell: !include-raw-escape: ../shell/openstack-cleanup-old-images.sh
1402
1403     publishers:
1404       - lf-infra-publish
1405
1406 - job-template:
1407     name: "{project-name}-openstack-cron"
1408     id: gerrit-openstack-cron
1409     <<: *lf_openstack_cron
1410
1411     scm:
1412       - lf-infra-gerrit-scm:
1413           git-url: "{git-url}"
1414           refspec: "refs/heads/{branch}"
1415           branch: "{branch}"
1416           submodule-recursive: true
1417           submodule-timeout: "{submodule-timeout}"
1418           submodule-disable: "{submodule-disable}"
1419           choosing-strategy: default
1420           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1421
1422 - job-template:
1423     name: "{project-name}-openstack-cron"
1424     id: github-openstack-cron
1425     <<: *lf_openstack_cron
1426
1427     scm:
1428       - lf-infra-github-scm:
1429           url: "{git-clone-url}{github-org}/{project}"
1430           refspec: ""
1431           branch: "refs/heads/{branch}"
1432           submodule-recursive: true
1433           submodule-timeout: "{submodule-timeout}"
1434           submodule-disable: "{submodule-disable}"
1435           choosing-strategy: default
1436           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1437
1438 ################
1439 # Packer Merge #
1440 ################
1441
1442 - lf_packer_merge: &lf_packer_merge
1443     name: lf-packer-merge
1444
1445     ######################
1446     # Default parameters #
1447     ######################
1448
1449     openstack: true
1450     openstack-cloud: vex
1451     update-cloud-image: false
1452
1453     #####################
1454     # Job Configuration #
1455     #####################
1456
1457     parameters:
1458       - lf-infra-parameters:
1459           project: "{project}"
1460           stream: "{stream}"
1461           branch: "{branch}"
1462       - lf-packer-parameters:
1463           packer-version: "{packer-version}"
1464       - bool:
1465           name: UPDATE_CLOUD_IMAGE
1466           default: "{update-cloud-image}"
1467           description: "Update new built image on the cloud."
1468
1469     builders:
1470       - lf-infra-packer-build:
1471           openstack: "{openstack}"
1472           openstack-cloud: "{openstack-cloud}"
1473           packer-cloud-settings: "{packer-cloud-settings}"
1474           packer-version: "{packer-version}"
1475           platform: "{platforms}"
1476           template: "{templates}"
1477           update-cloud-image: "{update-cloud-image}"
1478       - description-setter:
1479           regexp: '(\s+.*)(ZZCI\s+.*\d+-\d+\.\d+)'
1480           description: 'Image: \2'
1481       # - trigger-builds:
1482       #     - project: '{project-name}-openstack-update-cloud-image'
1483       #       block: false
1484       #       predefined-parameters: |
1485       #         GERRIT_BRANCH=$GERRIT_BRANCH
1486       #         GERRIT_PROJECT=$GERRIT_PROJECT
1487       #         GERRIT_REFSPEC=$GERRIT_REFSPEC
1488       #         NEW_IMAGE_NAME=$NEW_IMAGE_NAME
1489       #       property-file: variables.jenkins-trigger
1490       #       property-file-fail-on-missing: true
1491
1492     publishers:
1493       - lf-infra-publish
1494       - trigger-parameterized-builds:
1495           - project: "{project-name}-openstack-update-cloud-image"
1496             condition: UNSTABLE_OR_BETTER
1497             predefined-parameters: |
1498               NEW_IMAGE_NAME=$NEW_IMAGE_NAME
1499             property-file: variables.jenkins-trigger
1500             fail-on-missing: true
1501
1502 - job-template:
1503     name: "{project-name}-packer-merge-{platforms}-{templates}"
1504     id: gerrit-packer-merge
1505     <<: *lf_packer_common
1506     # yamllint disable-line rule:key-duplicates
1507     <<: *lf_packer_merge
1508
1509     ######################
1510     # Default parameters #
1511     ######################
1512
1513     git-url: "$GIT_URL/$GERRIT_PROJECT"
1514
1515     gerrit_merge_triggers:
1516       - change-merged-event
1517       - comment-added-contains-event:
1518           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
1519
1520     #####################
1521     # Job Configuration #
1522     #####################
1523
1524     scm:
1525       - lf-infra-gerrit-scm:
1526           git-url: "{git-url}"
1527           refspec: "$GERRIT_REFSPEC"
1528           branch: "$GERRIT_BRANCH"
1529           submodule-recursive: "{submodule-recursive}"
1530           submodule-timeout: "{submodule-timeout}"
1531           submodule-disable: "{submodule-disable}"
1532           choosing-strategy: default
1533           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1534
1535     triggers:
1536       - timed: "{obj:cron}"
1537       - gerrit:
1538           server-name: "{gerrit-server-name}"
1539           trigger-on: "{obj:gerrit_merge_triggers}"
1540           projects:
1541             - project-compare-type: ANT
1542               project-pattern: "{project}"
1543               branches:
1544                 - branch-compare-type: ANT
1545                   branch-pattern: "**/{branch}"
1546               file-paths:
1547                 - compare-type: REG_EXP
1548                   pattern: 'packer\/provision\/.*\.sh'
1549                 - compare-type: REG_EXP
1550                   pattern: 'packer\/provision\/.*\.bat'
1551                 - compare-type: REG_EXP
1552                   pattern: 'packer\/provision\/.*\.ps1'
1553                 - compare-type: REG_EXP
1554                   pattern: 'packer\/provision\/{templates}\.yaml'
1555                 - compare-type: REG_EXP
1556                   pattern: 'packer\/provision\/local-{templates}\.yaml'
1557                 - compare-type: REG_EXP
1558                   pattern: 'packer\/templates\/{templates}\.json'
1559                 - compare-type: REG_EXP
1560                   pattern: 'packer\/vars\/{platforms}\.json'
1561
1562 - job-template:
1563     name: "{project-name}-packer-merge-{platforms}-{templates}"
1564     id: github-packer-merge
1565     <<: *lf_packer_common
1566     # yamllint disable-line rule:key-duplicates
1567     <<: *lf_packer_merge
1568
1569     #####################
1570     # Job Configuration #
1571     #####################
1572
1573     properties:
1574       - lf-infra-properties:
1575           project: "{project}"
1576           build-days-to-keep: 7
1577       - github:
1578           url: "{github-url}/{github-org}/{project}"
1579
1580     scm:
1581       - lf-infra-github-scm:
1582           url: "{git-clone-url}{github-org}/{project}"
1583           refspec: >
1584             +refs/heads/*:refs/remotes/origin/*
1585             +refs/pull/*:refs/remotes/origin/pr/*
1586           branch: "$GERRIT_REFSPEC"
1587           submodule-recursive: "{submodule-recursive}"
1588           submodule-timeout: "{submodule-timeout}"
1589           submodule-disable: "{submodule-disable}"
1590           choosing-strategy: default
1591           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1592
1593     triggers:
1594       - timed: "{obj:cron}"
1595       - github
1596       - pollscm:
1597           cron: ""
1598
1599       - github-pull-request:
1600           trigger-phrase: "^remerge$"
1601           only-trigger-phrase: true
1602           status-context: "Packer {platforms}-{templates} Merge"
1603           permit-all: true
1604           github-hooks: true
1605           org-list:
1606             - "{github-org}"
1607           white-list: "{obj:github_pr_whitelist}"
1608           admin-list: "{obj:github_pr_admin_list}"
1609           # included-regions MUST match Gerrit Trigger file-paths
1610           included-regions:
1611             - 'packer\/provision\/.*\.sh'
1612             - 'packer\/provision\/.*\.bat'
1613             - 'packer\/provision\/.*\.ps1'
1614             - 'packer\/provision\/{templates}\.yaml'
1615             - 'packer\/provision\/local-{templates}\.yaml'
1616             - 'packer\/templates\/{templates}\.json'
1617             - 'packer\/vars\/{platforms}\.json'
1618           white-list-target-branches:
1619             - "{branch}"
1620
1621 - job-template:
1622     name: "{project-name}-packer-verify-build-{platforms}-{templates}"
1623     id: gerrit-packer-verify-build
1624     <<: *lf_packer_common
1625     # yamllint disable-line rule:key-duplicates
1626     <<: *lf_packer_merge
1627
1628     ######################
1629     # Default parameters #
1630     ######################
1631
1632     git-url: "$GIT_URL/$GERRIT_PROJECT"
1633
1634     gerrit_verify_triggers:
1635       - comment-added-contains-event:
1636           comment-contains-value: '^Patch Set\s+\d+:\s+(verify-build|packer-build)\s*$'
1637
1638     #####################
1639     # Job Configuration #
1640     #####################
1641
1642     scm:
1643       - lf-infra-gerrit-scm:
1644           git-url: "{git-url}"
1645           refspec: "$GERRIT_REFSPEC"
1646           branch: "$GERRIT_BRANCH"
1647           submodule-recursive: "{submodule-recursive}"
1648           submodule-timeout: "{submodule-timeout}"
1649           submodule-disable: "{submodule-disable}"
1650           choosing-strategy: gerrit
1651           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1652
1653     triggers:
1654       - gerrit:
1655           server-name: "{gerrit-server-name}"
1656           trigger-on: "{obj:gerrit_verify_triggers}"
1657           projects:
1658             - project-compare-type: ANT
1659               project-pattern: "{project}"
1660               branches:
1661                 - branch-compare-type: ANT
1662                   branch-pattern: "**/{branch}"
1663               file-paths:
1664                 - compare-type: REG_EXP
1665                   pattern: 'packer\/provision\/.*\.sh'
1666                 - compare-type: REG_EXP
1667                   pattern: 'packer\/provision\/.*\.bat'
1668                 - compare-type: REG_EXP
1669                   pattern: 'packer\/provision\/.*\.ps1'
1670                 - compare-type: REG_EXP
1671                   pattern: 'packer\/provision\/{templates}\.yaml'
1672                 - compare-type: REG_EXP
1673                   pattern: 'packer\/provision\/local-{templates}\.yaml'
1674                 - compare-type: REG_EXP
1675                   pattern: 'packer\/templates\/{templates}\.json'
1676                 - compare-type: REG_EXP
1677                   pattern: 'packer\/vars\/{platforms}\.json'
1678
1679 - job-template:
1680     name: "{project-name}-packer-verify-build-{platforms}-{templates}"
1681     id: github-packer-verify-build
1682     <<: *lf_packer_common
1683     # yamllint disable-line rule:key-duplicates
1684     <<: *lf_packer_merge
1685
1686     #####################
1687     # Job Configuration #
1688     #####################
1689
1690     properties:
1691       - lf-infra-properties:
1692           project: "{project}"
1693           build-days-to-keep: 7
1694       - github:
1695           url: "{github-url}/{github-org}/{project}"
1696
1697     scm:
1698       - lf-infra-github-scm:
1699           url: "{git-clone-url}{github-org}/{project}"
1700           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1701           branch: "$sha1"
1702           submodule-recursive: "{submodule-recursive}"
1703           submodule-timeout: "{submodule-timeout}"
1704           submodule-disable: "{submodule-disable}"
1705           choosing-strategy: default
1706           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1707
1708     triggers:
1709       - github-pull-request:
1710           trigger-phrase: "^(verify-build|packer-build)$"
1711           only-trigger-phrase: true
1712           status-context: "Packer {platforms}-{templates} Verify Build"
1713           permit-all: true
1714           github-hooks: true
1715           white-list-target-branches:
1716             - "{branch}"
1717           # included-regions MUST match Gerrit Trigger file-paths
1718           included-regions:
1719             - 'packer\/provision\/.*\.sh'
1720             - 'packer\/provision\/.*\.bat'
1721             - 'packer\/provision\/.*\.ps1'
1722             - 'packer\/provision\/{templates}\.yaml'
1723             - 'packer\/provision\/local-{templates}\.yaml'
1724             - 'packer\/templates\/{templates}\.json'
1725             - 'packer\/vars\/{platforms}\.json'
1726
1727 #################
1728 # Packer Verify #
1729 #################
1730
1731 - lf_packer_verify: &lf_packer_verify
1732     name: lf-packer-verify
1733
1734     ######################
1735     # Default parameters #
1736     ######################
1737
1738     build-timeout: 10
1739     openstack: true
1740     openstack-cloud: vex
1741
1742     gerrit_verify_triggers:
1743       - patchset-created-event:
1744           exclude-drafts: true
1745           exclude-trivial-rebase: false
1746           exclude-no-code-change: false
1747       - draft-published-event
1748       - comment-added-contains-event:
1749           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1750
1751     gerrit_trigger_file_paths:
1752       - compare-type: REG_EXP
1753         pattern: 'packer\/.*'
1754
1755     # github_included_regions MUST match gerrit_trigger_file_paths
1756     github_included_regions:
1757       - 'packer\/.*'
1758
1759     #####################
1760     # Job Configuration #
1761     #####################
1762
1763     concurrent: true
1764
1765     builders:
1766       - lf-infra-packer-validate:
1767           openstack: "{openstack}"
1768           openstack-cloud: "{openstack-cloud}"
1769           packer-cloud-settings: "{packer-cloud-settings}"
1770           packer-version: "{packer-version}"
1771
1772 - job-template:
1773     name: "{project-name}-packer-verify"
1774     id: gerrit-packer-verify
1775     <<: *lf_packer_common
1776     # yamllint disable-line rule:key-duplicates
1777     <<: *lf_packer_verify
1778
1779     ######################
1780     # Default parameters #
1781     ######################
1782
1783     git-url: "$GIT_URL/$GERRIT_PROJECT"
1784
1785     #####################
1786     # Job Configuration #
1787     #####################
1788
1789     scm:
1790       - lf-infra-gerrit-scm:
1791           git-url: "{git-url}"
1792           refspec: "$GERRIT_REFSPEC"
1793           branch: "$GERRIT_BRANCH"
1794           submodule-recursive: "{submodule-recursive}"
1795           submodule-timeout: "{submodule-timeout}"
1796           submodule-disable: "{submodule-disable}"
1797           choosing-strategy: gerrit
1798           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1799
1800     triggers:
1801       - gerrit:
1802           server-name: "{gerrit-server-name}"
1803           trigger-on: "{obj:gerrit_verify_triggers}"
1804           projects:
1805             - project-compare-type: ANT
1806               project-pattern: "{project}"
1807               branches:
1808                 - branch-compare-type: ANT
1809                   branch-pattern: "**/{branch}"
1810               file-paths: "{obj:gerrit_trigger_file_paths}"
1811
1812 - job-template:
1813     name: "{project-name}-packer-verify"
1814     id: github-packer-verify
1815     <<: *lf_packer_common
1816     # yamllint disable-line rule:key-duplicates
1817     <<: *lf_packer_verify
1818
1819     #####################
1820     # Job Configuration #
1821     #####################
1822
1823     properties:
1824       - lf-infra-properties:
1825           project: "{project}"
1826           build-days-to-keep: 7
1827       - github:
1828           url: "{github-url}/{github-org}/{project}"
1829
1830     scm:
1831       - lf-infra-github-scm:
1832           url: "{git-clone-url}{github-org}/{project}"
1833           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
1834           branch: "$sha1"
1835           submodule-recursive: "{submodule-recursive}"
1836           submodule-timeout: "{submodule-timeout}"
1837           submodule-disable: "{submodule-disable}"
1838           choosing-strategy: default
1839           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1840
1841     triggers:
1842       - github-pull-request:
1843           trigger-phrase: "^(recheck|reverify)$"
1844           only-trigger-phrase: false
1845           status-context: "Packer Verify"
1846           permit-all: true
1847           github-hooks: true
1848           included-regions: "{obj:github_included_regions}"
1849           white-list-target-branches:
1850             - "{branch}"
1851
1852 ################################
1853 # Openstack Update Cloud Image #
1854 ################################
1855
1856 - lf_openstack_cron: &lf_openstack_update_cloud_image
1857     name: lf-openstack-update-cloud-image
1858
1859     ######################
1860     # Default parameters #
1861     ######################
1862
1863     branch: master
1864     build-days-to-keep: 7
1865     build-timeout: 10
1866     cron: "@monthly"
1867     disable-job: false
1868     git-url: "$GIT_URL/$PROJECT"
1869     github-url: "https://github.com"
1870     new-image-name: "all"
1871     openstack-cloud: vex
1872     stream: master
1873     submodule-timeout: 10
1874     submodule-disable: false
1875     update-cloud-image: false
1876
1877     #####################
1878     # Job Configuration #
1879     #####################
1880
1881     project-type: freestyle
1882     node: "{build-node}"
1883     concurrent: false
1884     disabled: "{disable-job}"
1885
1886     properties:
1887       - lf-infra-properties:
1888           build-days-to-keep: "{build-days-to-keep}"
1889
1890     parameters:
1891       - lf-infra-parameters:
1892           project: "{project}"
1893           stream: "{stream}"
1894           branch: "{branch}"
1895       - string:
1896           name: NEW_IMAGE_NAME
1897           default: "{new-image-name}"
1898           description: "Name of cloud image to update in Jenkins"
1899
1900     wrappers:
1901       - lf-infra-wrappers:
1902           build-timeout: "{build-timeout}"
1903           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1904       # Listed after to override openstack-infra-wrappers clouds.yaml definition
1905       - config-file-provider:
1906           files:
1907             - file-id: clouds-yaml
1908               target: "$HOME/.config/openstack/clouds.yaml"
1909             - file-id: npmrc
1910               target: "$HOME/.npmrc"
1911             - file-id: pipconf
1912               target: "$HOME/.config/pip/pip.conf"
1913
1914     builders:
1915       - lf-infra-pre-build
1916       - inject:
1917           properties-content: |
1918             OS_CLOUD={openstack-cloud}
1919       - shell: |
1920           #!/bin/bash
1921           echo "Extract the image type for commit message"
1922           # echo IMAGE_TYPE=${{NEW_IMAGE_NAME% -*}} >> image-type.txt
1923           IMAGE_TYPE=$(echo ${{NEW_IMAGE_NAME}} | tr -d "\'\"\ " | awk -F- '{{ print $2 " " $3 " " $4 }}')
1924           echo IMAGE_TYPE=${{IMAGE_TYPE}} >> image-type.txt
1925           cat image-type.txt
1926       - inject:
1927           properties-file: "image-type.txt"
1928       - lf-infra-update-packer-images
1929       - lf-infra-push-gerrit-patch:
1930           project: "{project}"
1931           gerrit-user: "{gerrit-user}"
1932           gerrit-host: "{gerrit-host}"
1933           gerrit-topic: "{gerrit-topic}"
1934           gerrit-commit-message: "Update cloud image $IMAGE_TYPE"
1935           reviewers-email: "{reviewers-email}"
1936
1937     publishers:
1938       - lf-infra-publish
1939
1940 - job-template:
1941     name: "{project-name}-openstack-update-cloud-image"
1942     id: gerrit-openstack-update-cloud-image
1943     <<: *lf_openstack_update_cloud_image
1944
1945     ######################
1946     # Default parameters #
1947     ######################
1948
1949     git-url: "$GIT_URL/$GERRIT_PROJECT"
1950
1951     #####################
1952     # Job Configuration #
1953     #####################
1954
1955     scm:
1956       - lf-infra-gerrit-scm:
1957           git-url: "{git-url}"
1958           refspec: "$GERRIT_REFSPEC"
1959           branch: "$GERRIT_BRANCH"
1960           submodule-recursive: false
1961           submodule-timeout: "{submodule-timeout}"
1962           submodule-disable: "{submodule-disable}"
1963           choosing-strategy: gerrit
1964           jenkins-ssh-credential: "{jenkins-ssh-credential}"
1965
1966     triggers:
1967       - timed: "{obj:cron}"
1968
1969 #################
1970 # Puppet Verify #
1971 #################
1972
1973 - lf_puppet_verify: &lf_puppet_verify
1974     name: lf-puppet-verify
1975
1976     ######################
1977     # Default parameters #
1978     ######################
1979
1980     branch: master
1981     build-days-to-keep: 7
1982     build-timeout: 15
1983     disable-job: false
1984     git-url: "$GIT_URL/$GERRIT_PROJECT"
1985     github-url: "https://github.com"
1986     parallel: true
1987     puppet-dir: ""
1988     puppet-lint-version: 2.3.6
1989     stream: master
1990     submodule-recursive: true
1991     submodule-timeout: 10
1992     submodule-disable: false
1993
1994     gerrit_trigger_file_paths:
1995       - compare-type: REG_EXP
1996         pattern: ".*"
1997
1998     # github_included_regions MUST match gerrit_trigger_file_paths
1999     github_included_regions:
2000       - ".*"
2001
2002     #####################
2003     # Job Configuration #
2004     #####################
2005
2006     project-type: freestyle
2007     node: "{build-node}"
2008     concurrent: true
2009     disabled: "{disable-job}"
2010
2011     properties:
2012       - lf-infra-properties:
2013           build-days-to-keep: "{build-days-to-keep}"
2014
2015     parameters:
2016       - lf-infra-parameters:
2017           project: "{project}"
2018           branch: "{branch}"
2019           stream: "{stream}"
2020       - lf-puppet-parameters:
2021           puppet-lint-version: "{puppet-lint-version}"
2022
2023     wrappers:
2024       - lf-infra-wrappers:
2025           build-timeout: "{build-timeout}"
2026           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2027
2028     builders:
2029       - shell: !include-raw-escape: ../shell/puppet-lint.sh
2030
2031     publishers:
2032       - lf-infra-publish
2033
2034 - job-template:
2035     name: "{project-name}-puppet-verify"
2036     id: gerrit-puppet-verify
2037     <<: *lf_puppet_verify
2038
2039     ######################
2040     # Default parameters #
2041     ######################
2042
2043     gerrit_verify_triggers:
2044       - patchset-created-event:
2045           exclude-drafts: true
2046           exclude-trivial-rebase: false
2047           exclude-no-code-change: false
2048       - draft-published-event
2049       - comment-added-contains-event:
2050           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
2051
2052     #####################
2053     # Job Configuration #
2054     #####################
2055
2056     scm:
2057       - lf-infra-gerrit-scm:
2058           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2059           git-url: "{git-url}"
2060           refspec: "$GERRIT_REFSPEC"
2061           branch: "$GERRIT_BRANCH"
2062           submodule-recursive: "{submodule-recursive}"
2063           submodule-timeout: "{submodule-timeout}"
2064           submodule-disable: "{submodule-disable}"
2065           choosing-strategy: gerrit
2066
2067     triggers:
2068       - gerrit:
2069           server-name: "{gerrit-server-name}"
2070           trigger-on: "{obj:gerrit_verify_triggers}"
2071           projects:
2072             - project-compare-type: ANT
2073               project-pattern: "{project}"
2074               branches:
2075                 - branch-compare-type: ANT
2076                   branch-pattern: "**/{branch}"
2077               file-paths: "{obj:gerrit_trigger_file_paths}"
2078
2079 - job-template:
2080     name: "{project-name}-puppet-verify"
2081     id: github-puppet-verify
2082     <<: *lf_puppet_verify
2083
2084     #####################
2085     # Job Configuration #
2086     #####################
2087
2088     properties:
2089       - lf-infra-properties:
2090           project: "{project}"
2091           build-days-to-keep: 7
2092       - github:
2093           url: "{github-url}/{github-org}/{project}"
2094
2095     scm:
2096       - lf-infra-github-scm:
2097           url: "{git-clone-url}{github-org}/{project}"
2098           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
2099           branch: "$sha1"
2100           submodule-recursive: "{submodule-recursive}"
2101           submodule-timeout: "{submodule-timeout}"
2102           submodule-disable: "{submodule-disable}"
2103           choosing-strategy: default
2104           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2105
2106     triggers:
2107       - github-pull-request:
2108           trigger-phrase: "^(recheck|reverify)$"
2109           only-trigger-phrase: false
2110           status-context: "Puppet Verify"
2111           permit-all: true
2112           github-hooks: true
2113           included-regions: "{obj:github_included_regions}"
2114           white-list-target-branches:
2115             - "{branch}"
2116
2117 #########
2118 # Sonar #
2119 #########
2120
2121 - lf_sonar_common: &lf_sonar_common
2122     name: lf-sonar-common
2123
2124     ######################
2125     # Default parameters #
2126     ######################
2127
2128     archive-artifacts: >
2129       **/*.log
2130
2131     branch: master # Sonar should always be run on master branch
2132     build-days-to-keep: 7
2133     build-timeout: 60
2134     cron: "H H * * *" # run daily
2135     disable-job: false
2136     git-url: "$GIT_URL/$PROJECT"
2137     github-url: "https://github.com"
2138     stream: master
2139     submodule-recursive: true
2140     submodule-timeout: 10
2141     submodule-disable: false
2142
2143     # Sonar properties
2144     sonar-task: ""
2145     sonar-project-file: "sonar-project.properties"
2146     sonar-properties: ""
2147     sonar-java-opts: ""
2148     sonar-additional-args: ""
2149
2150     gerrit_trigger_file_paths:
2151       - compare-type: REG_EXP
2152         pattern: ".*"
2153
2154     # github_included_regions MUST match gerrit_trigger_file_paths
2155     github_included_regions:
2156       - ".*"
2157
2158     #####################
2159     # Job Configuration #
2160     #####################
2161
2162     project-type: freestyle
2163     node: "{build-node}"
2164
2165     properties:
2166       - lf-infra-properties:
2167           build-days-to-keep: "{build-days-to-keep}"
2168
2169     wrappers:
2170       - lf-infra-wrappers:
2171           build-timeout: "{build-timeout}"
2172           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2173
2174     disabled: "{disable-job}"
2175
2176     parameters:
2177       - lf-infra-parameters:
2178           project: "{project}"
2179           branch: "{branch}"
2180           stream: "{stream}"
2181       - string:
2182           name: ARCHIVE_ARTIFACTS
2183           default: "{archive-artifacts}"
2184           description: Artifacts to archive to the logs server.
2185
2186     publishers:
2187       - lf-infra-publish
2188
2189 - lf_sonar_builders: &lf_sonar_builders
2190     name: lf-sonar-builders
2191     builders:
2192       - lf-infra-pre-build
2193       - lf-infra-sonar:
2194           sonar-task: "{sonar-task}"
2195           sonar-project-file: "{sonar-project-file}"
2196           sonar-properties: "{sonar-properties}"
2197           sonar-java-opts: "{sonar-java-opts}"
2198           sonar-additional-args: "{sonar-additional-args}"
2199
2200 - lf_sonar_builders_prescan: &lf_sonar_builders_prescan
2201     name: lf-sonar-builders-prescan
2202     builders:
2203       - lf-infra-pre-build
2204       - lf-infra-sonar-with-prescan:
2205           sonar-task: "{sonar-task}"
2206           sonar-project-file: "{sonar-project-file}"
2207           sonar-properties: "{sonar-properties}"
2208           sonar-java-opts: "{sonar-java-opts}"
2209           sonar-additional-args: "{sonar-additional-args}"
2210
2211 - lf_sonar_builders_prescan_script: &lf_sonar_builders_prescan_script
2212     name: lf-sonar-builders-prescan-script
2213     builders:
2214       - lf-infra-pre-build
2215       - shell: "{sonar-prescan-script}"
2216       - lf-infra-sonar:
2217           sonar-task: "{sonar-task}"
2218           sonar-project-file: "{sonar-project-file}"
2219           sonar-properties: "{sonar-properties}"
2220           sonar-java-opts: "{sonar-java-opts}"
2221           sonar-additional-args: "{sonar-additional-args}"
2222
2223 - lf_sonar_gerrit_common: &lf_sonar_gerrit_common
2224     name: lf-sonar-gerrit-common
2225     gerrit_sonar_triggers:
2226       - comment-added-contains-event:
2227           comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
2228
2229     scm:
2230       - lf-infra-gerrit-scm:
2231           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2232           git-url: "{git-url}"
2233           refspec: $GERRIT_REFSPEC
2234           branch: $GERRIT_BRANCH
2235           submodule-recursive: "{submodule-recursive}"
2236           submodule-timeout: "{submodule-timeout}"
2237           submodule-disable: "{submodule-disable}"
2238           choosing-strategy: default
2239
2240     triggers:
2241       - timed: "{obj:cron}"
2242       - gerrit:
2243           server-name: "{gerrit-server-name}"
2244           trigger-on: "{obj:gerrit_sonar_triggers}"
2245           projects:
2246             - project-compare-type: "ANT"
2247               project-pattern: "{project}"
2248               branches:
2249                 - branch-compare-type: "ANT"
2250                   branch-pattern: "**/{branch}"
2251               file-paths: "{obj:gerrit_trigger_file_paths}"
2252           skip-vote:
2253             successful: true
2254             failed: true
2255             unstable: true
2256             notbuilt: true
2257
2258 - lf_sonar_github_common: &lf_sonar_github_common
2259     name: lf-sonar-github-common
2260     properties:
2261       - lf-infra-properties:
2262           build-days-to-keep: "{build-days-to-keep}"
2263       - github:
2264           url: "{github-url}/{github-org}/{project}"
2265
2266     scm:
2267       - lf-infra-github-scm:
2268           url: "{git-clone-url}{github-org}/{project}"
2269           refspec: "+refs/pull/*:refs/remotes/origin/pr/*"
2270           branch: "$sha1"
2271           submodule-recursive: "{submodule-recursive}"
2272           submodule-timeout: "{submodule-timeout}"
2273           submodule-disable: "{submodule-disable}"
2274           choosing-strategy: default
2275           jenkins-ssh-credential: "{jenkins-ssh-credential}"
2276
2277     triggers:
2278       - github-pull-request:
2279           trigger-phrase: "^run-sonar$"
2280           only-trigger-phrase: false
2281           status-context: "Python Sonar"
2282           permit-all: true
2283           github-hooks: true
2284           white-list-target-branches:
2285             - "{branch}"
2286           included-regions: "{obj:github_included_regions}"
2287
2288 - job-template:
2289     name: "{project-name}-sonar"
2290     id: gerrit-sonar
2291     <<: *lf_sonar_common
2292     # yamllint disable-line rule:key-duplicates
2293     <<: *lf_sonar_builders
2294     # yamllint disable-line rule:key-duplicates
2295     <<: *lf_sonar_gerrit_common
2296
2297 - job-template:
2298     name: "{project-name}-sonar"
2299     id: github-sonar
2300     <<: *lf_sonar_common
2301     # yamllint disable-line rule:key-duplicates
2302     <<: *lf_sonar_builders
2303     # yamllint disable-line rule:key-duplicates
2304     <<: *lf_sonar_github_common
2305
2306 - job-template:
2307     name: "{project-name}-sonar-prescan"
2308     id: gerrit-sonar-prescan
2309     <<: *lf_sonar_common
2310     # yamllint disable-line rule:key-duplicates
2311     <<: *lf_sonar_builders_prescan
2312     # yamllint disable-line rule:key-duplicates
2313     <<: *lf_sonar_gerrit_common
2314
2315 - job-template:
2316     name: "{project-name}-sonar-prescan"
2317     id: github-sonar-prescan
2318     <<: *lf_sonar_common
2319     # yamllint disable-line rule:key-duplicates
2320     <<: *lf_sonar_builders_prescan
2321     # yamllint disable-line rule:key-duplicates
2322     <<: *lf_sonar_github_common
2323
2324 - job-template:
2325     name: "{project-name}-sonar-prescan-script"
2326     id: gerrit-sonar-prescan-script
2327     <<: *lf_sonar_common
2328     # yamllint disable-line rule:key-duplicates
2329     <<: *lf_sonar_builders_prescan_script
2330     # yamllint disable-line rule:key-duplicates
2331     <<: *lf_sonar_gerrit_common
2332
2333 - job-template:
2334     name: "{project-name}-sonar-prescan-script"
2335     id: github-sonar-prescan-script
2336     <<: *lf_sonar_common
2337     # yamllint disable-line rule:key-duplicates
2338     <<: *lf_sonar_builders_prescan_script
2339     # yamllint disable-line rule:key-duplicates
2340     <<: *lf_sonar_github_common