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