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