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