Allow version-properties-file parameter
[releng/global-jjb.git] / jjb / lf-maven-jobs.yaml
1 ---
2 # This file contains job templates for Maven projects.
3
4 ##########
5 # Macros #
6 ##########
7
8 - builder:
9     name: lf-maven-build
10     builders:
11       - inject:
12           properties-content: 'MAVEN_GOALS={mvn-goals}'
13       - shell: !include-raw-escape:
14           - ../shell/common-variables.sh
15           - ../shell/maven-build.sh
16
17 - builder:
18     name: lf-maven-deploy
19     builders:
20       - shell: !include-raw:
21           - ../shell/common-variables.sh
22           - ../shell/maven-deploy.sh
23
24 - builder:
25     name: lf-maven-versions-plugin
26     builders:
27       - conditional-step:
28           condition-kind: boolean-expression
29           condition-expression: '{maven-versions-plugin}'
30           steps:
31             - inject:
32                 properties-file: '{version-properties-file}'
33             - maven-target:
34                 maven-version: '{mvn-version}'
35                 pom: '{mvn-pom}'
36                 goals: 'versions:set versions:update-child-modules versions:commit -B'
37                 properties:
38                   - 'newVersion=${{release_version}}'
39                 settings: '{mvn-settings}'
40                 settings-type: cfp
41                 global-settings: 'global-settings'
42                 global-settings-type: cfp
43
44 - builder:
45     name: lf-maven-stage
46     builders:
47       - lf-provide-maven-settings:
48           global-settings-file: '{mvn-global-settings}'
49           settings-file: '{mvn-settings}'
50       - lf-infra-create-netrc:
51           server-id: '{mvn-staging-id}'
52       # include-raw-escape fails due to JJB bug
53       - shell: !include-raw-escape:
54           - ../shell/common-variables.sh
55           - ../shell/maven-stage.sh
56       - lf-provide-maven-settings-cleanup
57
58 - builder:
59     name: lf-update-java-alternatives
60     builders:
61       - inject:
62           # Work around inject plugin overriding our GIT_URL variable incorrectly
63           # https://issues.jenkins-ci.org/browse/JENKINS-49775
64           properties-content: |
65             SET_JDK_VERSION={java-version}
66             GIT_URL="$GIT_URL"
67       - shell: !include-raw-escape: ../shell/update-java-alternatives.sh
68       - inject:
69           properties-file: '/tmp/java.env'
70
71 ####################
72 # COMMON FUNCTIONS #
73 ####################
74
75 - lf_maven_common: &lf_maven_common
76     name: lf-maven-common
77
78     ######################
79     # Default parameters #
80     ######################
81
82     archive-artifacts: >
83       **/*.log
84       **/hs_err_*.log
85       **/target/**/feature.xml
86       **/target/failsafe-reports/failsafe-summary.xml
87       **/target/surefire-reports/*-output.txt
88
89     #####################
90     # Job Configuration #
91     #####################
92
93     project-type: freestyle
94     node: '{build-node}'
95
96     properties:
97       - lf-infra-properties:
98           build-days-to-keep: '{build-days-to-keep}'
99
100     parameters:
101       - lf-infra-parameters:
102           project: '{project}'
103           branch: '{branch}'
104           stream: '{stream}'
105       - lf-infra-maven-parameters:
106           mvn-opts: '{mvn-opts}'
107           mvn-params: '{mvn-params}'
108           mvn-version: '{mvn-version}'
109       - string:
110           name: ARCHIVE_ARTIFACTS
111           default: '{archive-artifacts}'
112           description: Artifacts to archive to the logs server.
113
114     wrappers:
115       - lf-infra-wrappers:
116           build-timeout: '{build-timeout}'
117           jenkins-ssh-credential: '{jenkins-ssh-credential}'
118
119     publishers:
120       # TODO: Make email notification work.
121       # - lf-infra-email-notify:
122       #     email-recipients: '{email-recipients}'
123       #     email-prefix: '[releng]'
124       - lf-infra-publish
125
126 #############
127 # Maven CLM #
128 #############
129
130 - lf_maven_clm: &lf_maven_clm
131     name: lf-maven-clm
132
133     ######################
134     # Default parameters #
135     ######################
136
137     branch: master
138     build-days-to-keep: 30  # 30 days for troubleshooting purposes
139     build-timeout: 60
140     disable-job: false
141     git-url: '$GIT_URL/$PROJECT'
142     github-url: 'https://github.com'
143     java-version: openjdk8
144     mvn-global-settings: global-settings
145     mvn-opts: ''
146     mvn-params: ''
147     mvn-version: mvn35
148     nexus-iq-namespace: ''  # Recommend a trailing dash when set. Example: odl-
149     nexus-iq-stage: 'build'
150     stream: master
151     submodule-recursive: true
152     submodule-timeout: 10
153     submodule-disable: false
154
155     nexus_iq_scan_patterns:
156       - '**/*.ear'
157       - '**/*.jar'
158       - '**/*.tar.gz'
159       - '**/*.war'
160       - '**/*.zip'
161
162     gerrit_clm_triggers:
163       - comment-added-contains-event:
164           comment-contains-value: '^Patch Set\s+\d+:\s+run-clm\s*$'
165
166     parameters:
167       - lf-infra-parameters:
168           project: '{project}'
169           branch: '{branch}'
170           stream: '{stream}'
171       - lf-infra-maven-parameters:
172           mvn-opts: '{mvn-opts}'
173           mvn-params: '{mvn-params}'
174           mvn-version: '{mvn-version}'
175       - string:
176           name: ARCHIVE_ARTIFACTS
177           default: '{archive-artifacts}'
178           description: Artifacts to archive to the logs server.
179       - lf-clm-parameters:
180           nexus-iq-stage: '{nexus-iq-stage}'
181
182     #####################
183     # Job Configuration #
184     #####################
185
186     disabled: '{disable-job}'
187
188     builders:
189       - lf-infra-pre-build
190       - lf-maven-install:
191           mvn-version: '{mvn-version}'
192       - lf-update-java-alternatives:
193           java-version: '{java-version}'
194       - lf-provide-maven-settings:
195           global-settings-file: '{mvn-global-settings}'
196           settings-file: '{mvn-settings}'
197       - shell: !include-raw-escape:
198           - ../shell/common-variables.sh
199           - ../shell/sonatype-clm.sh
200       - lf-provide-maven-settings-cleanup
201       - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
202       - nexus-iq-policy-evaluator:
203           stage: '{nexus-iq-stage}'
204           application-type: 'manual'
205           application-id: '{nexus-iq-namespace}{project-name}'
206           scan-patterns: '{obj:nexus_iq_scan_patterns}'
207           fail-build-network-error: true
208
209 - job-template:
210     name: '{project-name}-maven-clm-{stream}'
211     id: gerrit-maven-clm
212     <<: *lf_maven_common
213     # yamllint disable-line rule:key-duplicates
214     <<: *lf_maven_clm
215
216     scm:
217       - lf-infra-gerrit-scm:
218           jenkins-ssh-credential: '{jenkins-ssh-credential}'
219           git-url: '{git-url}'
220           refspec: '$GERRIT_REFSPEC'
221           branch: '$GERRIT_BRANCH'
222           submodule-recursive: '{submodule-recursive}'
223           submodule-timeout: '{submodule-timeout}'
224           submodule-disable: '{submodule-disable}'
225           choosing-strategy: default
226
227     triggers:
228       # Build weekly on Saturdays
229       - timed: 'H H * * 6'
230       - gerrit:
231           server-name: '{gerrit-server-name}'
232           trigger-on: '{obj:gerrit_clm_triggers}'
233           projects:
234             - project-compare-type: ANT
235               project-pattern: '{project}'
236               branches:
237                 - branch-compare-type: ANT
238                   branch-pattern: '**/{branch}'
239           skip-vote:
240             successful: true
241             failed: true
242             unstable: true
243             notbuilt: true
244
245 - job-template:
246     name: '{project-name}-maven-clm-{stream}'
247     id: github-maven-clm
248     <<: *lf_maven_common
249     # yamllint disable-line rule:key-duplicates
250     <<: *lf_maven_clm
251
252     properties:
253       - lf-infra-properties:
254           build-days-to-keep: '{build-days-to-keep}'
255       - github:
256           url: '{github-url}/{github-org}/{project}'
257
258     scm:
259       - lf-infra-github-scm:
260           url: '{git-clone-url}{github-org}/{project}'
261           refspec: ''
262           branch: 'refs/heads/{branch}'
263           submodule-recursive: '{submodule-recursive}'
264           submodule-timeout: '{submodule-timeout}'
265           submodule-disable: '{submodule-disable}'
266           choosing-strategy: default
267           jenkins-ssh-credential: '{jenkins-ssh-credential}'
268
269     triggers:
270       # Build weekly on Saturdays
271       - timed: 'H H * * 6'
272       - github-pull-request:
273           trigger-phrase: '^run-clm$'
274           only-trigger-phrase: true
275           status-context: 'CLM'
276           permit-all: true
277           github-hooks: true
278           org-list:
279             - '{github-org}'
280           white-list: '{obj:github_pr_whitelist}'
281           admin-list: '{obj:github_pr_admin_list}'
282           white-list-target-branches:
283             - '{branch}'
284
285 #########################
286 # Maven Javadoc Publish #
287 #########################
288
289 - lf_maven_javadoc_publish: &lf_maven_javadoc_publish
290     name: lf-maven-javadoc-publish
291
292     ######################
293     # Default parameters #
294     ######################
295
296     branch: master
297     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
298     build-timeout: 60
299     disable-job: false
300     git-url: '$GIT_URL/$PROJECT'
301     github-url: 'https://github.com'
302     java-version: openjdk8
303     mvn-global-settings: global-settings
304     mvn-opts: ''
305     mvn-params: ''
306     mvn-version: mvn35
307     stream: master
308     submodule-recursive: true
309     submodule-timeout: 10
310     submodule-disable: false
311
312     gerrit_merge_triggers:
313       - change-merged-event
314       - comment-added-contains-event:
315           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
316
317     #####################
318     # Job Configuration #
319     #####################
320
321     disabled: '{disable-job}'
322
323     builders:
324       - lf-infra-pre-build
325       - lf-maven-install:
326           mvn-version: '{mvn-version}'
327       - lf-update-java-alternatives:
328           java-version: '{java-version}'
329       - lf-provide-maven-settings:
330           global-settings-file: '{mvn-global-settings}'
331           settings-file: '{mvn-settings}'
332       - lf-infra-create-netrc:
333           server-id: '{mvn-site-id}'
334       - inject:
335           properties-content: 'DEPLOY_PATH={javadoc-path}'
336       - shell: !include-raw-escape:
337           - ../shell/common-variables.sh
338           - ../shell/maven-javadoc-generate.sh
339           - ../shell/maven-javadoc-publish.sh
340       - lf-provide-maven-settings-cleanup
341
342 - job-template:
343     name: '{project-name}-maven-javadoc-publish-{stream}-{java-version}'
344     id: gerrit-maven-javadoc-publish
345     <<: *lf_maven_common
346     # yamllint disable-line rule:key-duplicates
347     <<: *lf_maven_javadoc_publish
348
349     git-url: '$GIT_URL/$GERRIT_PROJECT'
350
351     scm:
352       - lf-infra-gerrit-scm:
353           git-url: '{git-url}'
354           refspec: ''
355           branch: '{branch}'
356           submodule-recursive: '{submodule-recursive}'
357           submodule-timeout: '{submodule-timeout}'
358           submodule-disable: '{submodule-disable}'
359           choosing-strategy: default
360           jenkins-ssh-credential: '{jenkins-ssh-credential}'
361
362     triggers:
363       - gerrit:
364           server-name: '{gerrit-server-name}'
365           trigger-on: '{obj:gerrit_merge_triggers}'
366           projects:
367             - project-compare-type: ANT
368               project-pattern: '{project}'
369               branches:
370                 - branch-compare-type: ANT
371                   branch-pattern: '**/{branch}'
372
373 - job-template:
374     name: '{project-name}-maven-javadoc-publish-{stream}-{java-version}'
375     id: github-maven-javadoc-publish
376     <<: *lf_maven_common
377     # yamllint disable-line rule:key-duplicates
378     <<: *lf_maven_javadoc_publish
379
380     properties:
381       - lf-infra-properties:
382           build-days-to-keep: '{build-days-to-keep}'
383       - github:
384           url: '{github-url}/{github-org}/{project}'
385
386     scm:
387       - lf-infra-github-scm:
388           url: '{git-clone-url}{github-org}/{project}'
389           refspec: ''
390           branch: '{branch}'
391           submodule-recursive: '{submodule-recursive}'
392           submodule-timeout: '{submodule-timeout}'
393           submodule-disable: '{submodule-disable}'
394           choosing-strategy: default
395           jenkins-ssh-credential: '{jenkins-ssh-credential}'
396
397     triggers:
398       - github
399       - pollscm:
400           cron: ''
401       - github-pull-request:
402           trigger-phrase: '^remerge$'
403           only-trigger-phrase: true
404           status-context: 'Maven Javadoc Publish'
405           permit-all: true
406           github-hooks: true
407           org-list:
408             - '{github-org}'
409           white-list: '{obj:github_pr_whitelist}'
410           admin-list: '{obj:github_pr_admin_list}'
411           white-list-target-branches:
412             - '{branch}'
413
414 ########################
415 # Maven Javadoc Verify #
416 ########################
417
418 - lf_maven_javadoc_verify: &lf_maven_javadoc_verify
419     name: lf-maven-javadoc-verify
420
421     ######################
422     # Default parameters #
423     ######################
424
425     branch: master
426     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
427     build-timeout: 60
428     disable-job: false
429     git-url: '$GIT_URL/$PROJECT'
430     github-url: 'https://github.com'
431     java-version: openjdk8
432     mvn-global-settings: global-settings
433     mvn-opts: ''
434     mvn-params: ''
435     mvn-version: mvn35
436     stream: master
437     submodule-recursive: true
438     submodule-timeout: 10
439     submodule-disable: false
440
441     gerrit_verify_triggers:
442       - patchset-created-event:
443           exclude-drafts: true
444           exclude-trivial-rebase: false
445           exclude-no-code-change: false
446       - draft-published-event
447       - comment-added-contains-event:
448           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
449
450     #####################
451     # Job Configuration #
452     #####################
453
454     concurrent: true
455     disabled: '{disable-job}'
456
457     builders:
458       - lf-infra-pre-build
459       - lf-maven-install:
460           mvn-version: '{mvn-version}'
461       - lf-update-java-alternatives:
462           java-version: '{java-version}'
463       - lf-provide-maven-settings:
464           global-settings-file: '{mvn-global-settings}'
465           settings-file: '{mvn-settings}'
466       - shell: !include-raw-escape:
467           - ../shell/common-variables.sh
468           - ../shell/maven-javadoc-generate.sh
469       - lf-provide-maven-settings-cleanup
470
471 - job-template:
472     name: '{project-name}-maven-javadoc-verify-{stream}-{java-version}'
473     id: gerrit-maven-javadoc-verify
474     <<: *lf_maven_common
475     # yamllint disable-line rule:key-duplicates
476     <<: *lf_maven_javadoc_verify
477
478     scm:
479       - lf-infra-gerrit-scm:
480           jenkins-ssh-credential: '{jenkins-ssh-credential}'
481           git-url: '{git-url}'
482           refspec: '$GERRIT_REFSPEC'
483           branch: '$GERRIT_BRANCH'
484           submodule-recursive: '{submodule-recursive}'
485           submodule-timeout: '{submodule-timeout}'
486           submodule-disable: '{submodule-disable}'
487           choosing-strategy: gerrit
488
489     triggers:
490       - gerrit:
491           server-name: '{gerrit-server-name}'
492           trigger-on: '{obj:gerrit_verify_triggers}'
493           projects:
494             - project-compare-type: ANT
495               project-pattern: '{project}'
496               branches:
497                 - branch-compare-type: ANT
498                   branch-pattern: '**/{branch}'
499
500 - job-template:
501     name: '{project-name}-maven-javadoc-verify-{stream}-{java-version}'
502     id: github-maven-javadoc-verify
503     <<: *lf_maven_common
504     # yamllint disable-line rule:key-duplicates
505     <<: *lf_maven_javadoc_verify
506
507     properties:
508       - lf-infra-properties:
509           build-days-to-keep: '{build-days-to-keep}'
510       - github:
511           url: '{github-url}/{github-org}/{project}'
512
513     scm:
514       - lf-infra-github-scm:
515           url: '{git-clone-url}{github-org}/{project}'
516           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
517           branch: '$sha1'
518           submodule-recursive: '{submodule-recursive}'
519           submodule-timeout: '{submodule-timeout}'
520           submodule-disable: '{submodule-disable}'
521           choosing-strategy: default
522           jenkins-ssh-credential: '{jenkins-ssh-credential}'
523
524     triggers:
525       - github-pull-request:
526           trigger-phrase: ^(recheck|reverify)$
527           only-trigger-phrase: false
528           status-context: 'Maven Javadoc Verify'
529           permit-all: true
530           github-hooks: true
531           white-list-target-branches:
532             - '{branch}'
533
534 ###############
535 # Maven Merge #
536 ###############
537
538 - lf_maven_merge: &lf_maven_merge
539     name: lf-maven-merge
540
541     ######################
542     # Default parameters #
543     ######################
544
545     branch: master
546     build-days-to-keep: 30  # 30 days in case we need to troubleshoot
547     build-timeout: 60
548     cron: '@daily'
549     disable-job: false
550     git-url: '$GIT_URL/$PROJECT'
551     github-url: 'https://github.com'
552     java-version: openjdk8
553     mvn-global-settings: global-settings
554     mvn-goals: clean deploy
555     mvn-opts: ''
556     mvn-params: '-Dmerge'
557     mvn-version: mvn35
558     nexus-cut-dirs: 6  # Number of dirs in the Nexus path to remove for wget -r.
559     stream: master
560     submodule-recursive: true
561     submodule-timeout: 10
562     submodule-disable: false
563
564     gerrit_merge_triggers:
565       - change-merged-event
566       - comment-added-contains-event:
567           comment-contains-value: '^Patch Set\s+\d+:\s+remerge\s*$'
568
569     gerrit_trigger_file_paths:
570       - compare-type: REG_EXP
571         pattern: '.*'
572
573     # github_included_regions MUST match gerrit_trigger_file_paths
574     github_included_regions:
575       - '.*'
576
577     post_build_trigger: ''
578
579     #####################
580     # Job Configuration #
581     #####################
582
583     disabled: '{disable-job}'
584
585     builders:
586       - lf-infra-pre-build
587       - lf-jacoco-nojava-workaround
588       - lf-maven-install:
589           mvn-version: '{mvn-version}'
590       - lf-update-java-alternatives:
591           java-version: '{java-version}'
592       - lf-provide-maven-settings:
593           global-settings-file: '{mvn-global-settings}'
594           settings-file: '{mvn-settings}'
595       - lf-infra-create-netrc:
596           server-id: '{mvn-snapshot-id}'
597       - inject:
598           properties-content: |
599               NEXUS_CUT_DIRS={nexus-cut-dirs}
600               NEXUS_REPO={nexus-snapshot-repo}
601       - shell: !include-raw-escape: ../shell/maven-fetch-metadata.sh
602       - lf-maven-build:
603           mvn-goals: '{mvn-goals}'
604       - lf-maven-deploy
605       - lf-provide-maven-settings-cleanup
606
607     publishers:
608       - findbugs
609       - lf-jacoco-report
610       - lf-infra-publish
611       - trigger-parameterized-builds: '{obj:post_build_trigger}'
612
613 - job-template:
614     name: '{project-name}-maven-merge-{stream}'
615     id: gerrit-maven-merge
616     <<: *lf_maven_common
617     # yamllint disable-line rule:key-duplicates
618     <<: *lf_maven_merge
619
620     scm:
621       - lf-infra-gerrit-scm:
622           jenkins-ssh-credential: '{jenkins-ssh-credential}'
623           git-url: '{git-url}'
624           refspec: '$GERRIT_REFSPEC'
625           branch: '$GERRIT_BRANCH'
626           submodule-recursive: '{submodule-recursive}'
627           submodule-timeout: '{submodule-timeout}'
628           submodule-disable: '{submodule-disable}'
629           choosing-strategy: default
630
631     triggers:
632       - timed: '{obj:cron}'
633       - gerrit:
634           server-name: '{gerrit-server-name}'
635           trigger-on: '{obj:gerrit_merge_triggers}'
636           projects:
637             - project-compare-type: ANT
638               project-pattern: '{project}'
639               branches:
640                 - branch-compare-type: ANT
641                   branch-pattern: '**/{branch}'
642               file-paths: '{obj:gerrit_trigger_file_paths}'
643
644 - job-template:
645     name: '{project-name}-maven-merge-{stream}'
646     id: github-maven-merge
647     <<: *lf_maven_common
648     # yamllint disable-line rule:key-duplicates
649     <<: *lf_maven_merge
650
651     properties:
652       - lf-infra-properties:
653           build-days-to-keep: '{build-days-to-keep}'
654       - github:
655           url: '{github-url}/{github-org}/{project}'
656
657     scm:
658       - lf-infra-github-scm:
659           url: '{git-clone-url}{github-org}/{project}'
660           refspec: ''
661           branch: 'refs/heads/{branch}'
662           submodule-recursive: '{submodule-recursive}'
663           submodule-timeout: '{submodule-timeout}'
664           submodule-disable: '{submodule-disable}'
665           choosing-strategy: default
666           jenkins-ssh-credential: '{jenkins-ssh-credential}'
667
668     triggers:
669       - timed: '{obj:cron}'
670       - github
671       - pollscm:
672           cron: ''
673       - github-pull-request:
674           trigger-phrase: '^remerge$'
675           only-trigger-phrase: true
676           status-context: 'Maven Merge'
677           permit-all: true
678           github-hooks: true
679           org-list:
680             - '{github-org}'
681           white-list: '{obj:github_pr_whitelist}'
682           admin-list: '{obj:github_pr_admin_list}'
683           white-list-target-branches:
684             - '{branch}'
685           included-regions: '{obj:github_included_regions}'
686
687 ##########################
688 # Maven Merge for Docker #
689 ##########################
690
691 - lf_maven_docker_merge: &lf_maven_docker_merge
692     name: lf-maven-docker-merge
693
694     builders:
695       - lf-infra-pre-build
696       - lf-jacoco-nojava-workaround
697       - lf-maven-install:
698           mvn-version: '{mvn-version}'
699       - lf-infra-docker-login:
700           global-settings-file: '{mvn-global-settings}'
701           settings-file: '{mvn-settings}'
702       - lf-update-java-alternatives:
703           java-version: '{java-version}'
704       # must provide maven settings AFTER docker due to its cleanup
705       - lf-provide-maven-settings:
706           global-settings-file: '{mvn-global-settings}'
707           settings-file: '{mvn-settings}'
708       - lf-infra-create-netrc:
709           server-id: '{mvn-snapshot-id}'
710       - inject:
711           properties-content: |
712               NEXUS_CUT_DIRS={nexus-cut-dirs}
713               NEXUS_REPO={nexus-snapshot-repo}
714               CONTAINER_PULL_REGISTRY={container-public-registry}
715               CONTAINER_PUSH_REGISTRY={container-snapshot-registry}
716       - shell: !include-raw-escape: ../shell/maven-fetch-metadata.sh
717       - lf-maven-build:
718           mvn-goals: '{mvn-goals}'
719       # NO lf-maven-deploy
720       - lf-provide-maven-settings-cleanup
721
722 - job-template:
723     name: '{project-name}-maven-docker-merge-{stream}'
724     id: gerrit-maven-docker-merge
725     <<: *lf_maven_common
726     # yamllint disable-line rule:key-duplicates
727     <<: *lf_maven_merge
728     # yamllint disable-line rule:key-duplicates
729     <<: *lf_maven_docker_merge
730
731     scm:
732       - lf-infra-gerrit-scm:
733           jenkins-ssh-credential: '{jenkins-ssh-credential}'
734           git-url: '{git-url}'
735           refspec: '$GERRIT_REFSPEC'
736           branch: '$GERRIT_BRANCH'
737           submodule-recursive: '{submodule-recursive}'
738           submodule-timeout: '{submodule-timeout}'
739           submodule-disable: '{submodule-disable}'
740           choosing-strategy: default
741
742     triggers:
743       - gerrit:
744           server-name: '{gerrit-server-name}'
745           trigger-on: '{obj:gerrit_merge_triggers}'
746           projects:
747             - project-compare-type: ANT
748               project-pattern: '{project}'
749               branches:
750                 - branch-compare-type: ANT
751                   branch-pattern: '**/{branch}'
752               file-paths: '{obj:gerrit_trigger_file_paths}'
753
754 - job-template:
755     name: '{project-name}-maven-docker-merge-{stream}'
756     id: github-maven-docker-merge
757     <<: *lf_maven_common
758     # yamllint disable-line rule:key-duplicates
759     <<: *lf_maven_merge
760     # yamllint disable-line rule:key-duplicates
761     <<: *lf_maven_docker_merge
762
763     properties:
764       - lf-infra-properties:
765           build-days-to-keep: '{build-days-to-keep}'
766       - github:
767           url: '{github-url}/{github-org}/{project}'
768
769     scm:
770       - lf-infra-github-scm:
771           url: '{git-clone-url}{github-org}/{project}'
772           refspec: ''
773           branch: 'refs/heads/{branch}'
774           submodule-recursive: '{submodule-recursive}'
775           submodule-timeout: '{submodule-timeout}'
776           submodule-disable: '{submodule-disable}'
777           choosing-strategy: default
778           jenkins-ssh-credential: '{jenkins-ssh-credential}'
779
780     triggers:
781       - github
782       - pollscm:
783           cron: ''
784       - github-pull-request:
785           trigger-phrase: '^remerge$'
786           only-trigger-phrase: true
787           status-context: 'Maven Docker Merge'
788           permit-all: true
789           github-hooks: true
790           org-list:
791             - '{github-org}'
792           white-list: '{obj:github_pr_whitelist}'
793           admin-list: '{obj:github_pr_admin_list}'
794           white-list-target-branches:
795             - '{branch}'
796           included-regions: '{obj:github_included_regions}'
797
798 ###############
799 # Maven Stage #
800 ###############
801
802 - lf_maven_stage: &lf_maven_stage
803     name: lf-maven-stage
804
805     ######################
806     # Default parameters #
807     ######################
808
809     branch: master
810     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
811     build-timeout: 60
812     cron: '@daily'
813     disable-job: false
814     git-url: '$GIT_URL/$PROJECT'
815     github-url: 'https://github.com'
816     java-version: openjdk8
817     maven-versions-plugin: false
818     version-properties-file: version.properties
819     mvn-central: false
820     mvn-global-settings: global-settings
821     mvn-goals: clean deploy
822     mvn-opts: ''
823     mvn-params: ''
824     mvn-version: mvn35
825     ossrh-profile-id: ''
826     mvn-pom: ''
827     sign-artifacts: false
828     sign-mode: serial
829     stream: master
830     submodule-recursive: true
831     submodule-timeout: 10
832     submodule-disable: false
833
834     gerrit_release_triggers:
835       - comment-added-contains-event:
836           comment-contains-value: '^Patch Set\s+\d+:\s+stage-release\s*$'
837
838     gerrit_trigger_file_paths:
839       - compare-type: ANT
840         pattern: '**'
841
842     # github_included_regions MUST match gerrit_trigger_file_paths
843     github_included_regions:
844       - '.*'
845
846     #####################
847     # Job Configuration #
848     #####################
849
850     disabled: '{disable-job}'
851
852     parameters:
853       - lf-infra-parameters:
854           project: '{project}'
855           branch: '{branch}'
856           stream: '{stream}'
857       - lf-infra-maven-parameters:
858           mvn-opts: '{mvn-opts}'
859           mvn-params: '{mvn-params}'
860           mvn-version: '{mvn-version}'
861           staging-profile-id: '{staging-profile-id}'
862       - bool:
863           name: MAVEN_VERSIONS_PLUGIN
864           default: '{maven-versions-plugin}'
865           description: Use maven-versions-plugin to update pom versions.
866       - string:
867           name: ARCHIVE_ARTIFACTS
868           default: '{archive-artifacts}'
869           description: Artifacts to archive to the logs server.
870       - string:
871           name: STAGING_PROFILE_ID
872           default: '{staging-profile-id}'
873           description: Nexus staging profile ID.
874
875     builders:
876       - lf-infra-pre-build
877       - lf-jacoco-nojava-workaround
878       - lf-maven-install:
879           mvn-version: '{mvn-version}'
880       - lf-update-java-alternatives:
881           java-version: '{java-version}'
882       - lf-provide-maven-settings:
883           global-settings-file: '{mvn-global-settings}'
884           settings-file: '{mvn-settings}'
885       - lf-maven-versions-plugin:
886           maven-versions-plugin: '{maven-versions-plugin}'
887           version-properties-file: '{version-properties-file}'
888           mvn-version: '{mvn-version}'
889           mvn-pom: '{mvn-pom}'
890           mvn-settings: '{mvn-settings}'
891       - shell: !include-raw-escape: ../shell/maven-patch-release.sh
892       - lf-maven-build:
893           mvn-goals: '{mvn-goals}'
894       - lf-sigul-sign-dir:
895           sign-artifacts: '{sign-artifacts}'
896           sign-dir: '$WORKSPACE/m2repo'
897           sign-mode: '{sign-mode}'
898       - lf-maven-stage:
899           mvn-global-settings: '{mvn-global-settings}'
900           mvn-settings: '{mvn-settings}'
901           mvn-staging-id: '{mvn-staging-id}'
902       - lf-maven-central:
903           mvn-central: '{mvn-central}'
904           mvn-global-settings: '{mvn-global-settings}'
905           mvn-settings: '{mvn-settings}'
906           ossrh-profile-id: '{ossrh-profile-id}'
907       - lf-provide-maven-settings-cleanup
908
909 - job-template:
910     name: '{project-name}-maven-stage-{stream}'
911     id: gerrit-maven-stage
912     <<: *lf_maven_common
913     # yamllint disable-line rule:key-duplicates
914     <<: *lf_maven_stage
915
916     scm:
917       - lf-infra-gerrit-scm:
918           jenkins-ssh-credential: '{jenkins-ssh-credential}'
919           git-url: '{git-url}'
920           refspec: '$GERRIT_REFSPEC'
921           branch: '$GERRIT_BRANCH'
922           submodule-recursive: '{submodule-recursive}'
923           submodule-timeout: '{submodule-timeout}'
924           submodule-disable: '{submodule-disable}'
925           choosing-strategy: default
926
927     triggers:
928       - timed: '{obj:cron}'
929       - gerrit:
930           server-name: '{gerrit-server-name}'
931           trigger-on: '{obj:gerrit_release_triggers}'
932           projects:
933             - project-compare-type: ANT
934               project-pattern: '{project}'
935               branches:
936                 - branch-compare-type: ANT
937                   branch-pattern: '**/{branch}'
938               file-paths: '{obj:gerrit_trigger_file_paths}'
939
940 - job-template:
941     name: '{project-name}-maven-stage-{stream}'
942     id: github-maven-stage
943     <<: *lf_maven_common
944     # yamllint disable-line rule:key-duplicates
945     <<: *lf_maven_stage
946
947     properties:
948       - lf-infra-properties:
949           build-days-to-keep: '{build-days-to-keep}'
950       - github:
951           url: '{github-url}/{github-org}/{project}'
952
953     scm:
954       - lf-infra-github-scm:
955           url: '{git-clone-url}{github-org}/{project}'
956           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
957           branch: '{branch}'
958           submodule-recursive: '{submodule-recursive}'
959           submodule-timeout: '{submodule-timeout}'
960           submodule-disable: '{submodule-disable}'
961           choosing-strategy: default
962           jenkins-ssh-credential: '{jenkins-ssh-credential}'
963
964     triggers:
965       - timed: '{obj:cron}'
966       - github-pull-request:
967           trigger-phrase: '^build release$'
968           only-trigger-phrase: true
969           status-context: 'Maven Release'
970           permit-all: true
971           github-hooks: true
972           white-list-target-branches:
973             - '{branch}'
974           included-regions: '{obj:github_included_regions}'
975
976 ##########################
977 # Maven Stage for Docker #
978 ##########################
979
980 - lf_maven_docker_stage: &lf_maven_docker_stage
981     name: lf-maven-docker-stage
982
983     builders:
984       - lf-infra-pre-build
985       - lf-jacoco-nojava-workaround
986       - lf-maven-install:
987           mvn-version: '{mvn-version}'
988       - lf-update-java-alternatives:
989           java-version: '{java-version}'
990       - lf-infra-docker-login:
991           global-settings-file: '{mvn-global-settings}'
992           settings-file: '{mvn-settings}'
993       # must provide maven settings AFTER docker-login due to its cleanup
994       - lf-provide-maven-settings:
995           global-settings-file: '{mvn-global-settings}'
996           settings-file: '{mvn-settings}'
997       - lf-maven-versions-plugin:
998           maven-versions-plugin: '{maven-versions-plugin}'
999           version-properties-file: '{version-properties-file}'
1000           mvn-version: '{mvn-version}'
1001           mvn-pom: '{mvn-pom}'
1002           mvn-settings: '{mvn-settings}'
1003       - shell: !include-raw-escape: ../shell/maven-patch-release.sh
1004       - inject:
1005           properties-content: |
1006               CONTAINER_PULL_REGISTRY={container-public-registry}
1007               CONTAINER_PUSH_REGISTRY={container-staging-registry}
1008       - lf-maven-build:
1009           mvn-goals: '{mvn-goals}'
1010       - lf-sigul-sign-dir:
1011           sign-artifacts: '{sign-artifacts}'
1012           sign-dir: '$WORKSPACE/m2repo'
1013           sign-mode: '{sign-mode}'
1014       # NO lf-maven-stage
1015       # NO lf-maven-central
1016       - lf-provide-maven-settings-cleanup
1017
1018 - job-template:
1019     name: '{project-name}-maven-docker-stage-{stream}'
1020     id: gerrit-maven-docker-stage
1021     <<: *lf_maven_common
1022     # yamllint disable-line rule:key-duplicates
1023     <<: *lf_maven_stage
1024     # yamllint disable-line rule:key-duplicates
1025     <<: *lf_maven_docker_stage
1026
1027     scm:
1028       - lf-infra-gerrit-scm:
1029           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1030           git-url: '{git-url}'
1031           refspec: '$GERRIT_REFSPEC'
1032           branch: '$GERRIT_BRANCH'
1033           submodule-recursive: '{submodule-recursive}'
1034           submodule-timeout: '{submodule-timeout}'
1035           submodule-disable: '{submodule-disable}'
1036           choosing-strategy: default
1037
1038     triggers:
1039       - timed: '{obj:cron}'
1040       - gerrit:
1041           server-name: '{gerrit-server-name}'
1042           trigger-on: '{obj:gerrit_release_triggers}'
1043           projects:
1044             - project-compare-type: ANT
1045               project-pattern: '{project}'
1046               branches:
1047                 - branch-compare-type: ANT
1048                   branch-pattern: '**/{branch}'
1049               file-paths: '{obj:gerrit_trigger_file_paths}'
1050
1051 - job-template:
1052     name: '{project-name}-maven-docker-stage-{stream}'
1053     id: github-maven-docker-stage
1054     <<: *lf_maven_common
1055     # yamllint disable-line rule:key-duplicates
1056     <<: *lf_maven_stage
1057     # yamllint disable-line rule:key-duplicates
1058     <<: *lf_maven_docker_stage
1059
1060     properties:
1061       - lf-infra-properties:
1062           build-days-to-keep: '{build-days-to-keep}'
1063       - github:
1064           url: '{github-url}/{github-org}/{project}'
1065
1066     scm:
1067       - lf-infra-github-scm:
1068           url: '{git-clone-url}{github-org}/{project}'
1069           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1070           branch: '{branch}'
1071           submodule-recursive: '{submodule-recursive}'
1072           submodule-timeout: '{submodule-timeout}'
1073           submodule-disable: '{submodule-disable}'
1074           choosing-strategy: default
1075           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1076
1077     triggers:
1078       - timed: '{obj:cron}'
1079       - github-pull-request:
1080           trigger-phrase: '^build release$'
1081           only-trigger-phrase: true
1082           status-context: 'Maven Release'
1083           permit-all: true
1084           github-hooks: true
1085           white-list-target-branches:
1086             - '{branch}'
1087           included-regions: '{obj:github_included_regions}'
1088
1089 ###############
1090 # Maven Sonar #
1091 ###############
1092
1093 - lf_maven_sonar: &lf_maven_sonar
1094     name: lf-maven-sonar
1095
1096     ######################
1097     # Default parameters #
1098     ######################
1099
1100     branch: master  # Sonar should always be run on master branch
1101     build-days-to-keep: 7
1102     build-timeout: 60
1103     cron: 'H H * * 6'  # run weekly
1104     disable-job: false
1105     git-url: '$GIT_URL/$PROJECT'
1106     github-url: 'https://github.com'
1107     java-version: openjdk8
1108     mvn-global-settings: global-settings
1109     mvn-opts: ''
1110     mvn-params: ''
1111     mvn-version: mvn35
1112     sonar-mvn-goal: 'sonar:sonar'
1113     sonarcloud: false
1114     sonarcloud-project-key: ''
1115     sonarcloud-project-organization: ''
1116     sonarcloud-api-token: ''
1117     stream: master
1118     submodule-recursive: true
1119     submodule-timeout: 10
1120     submodule-disable: false
1121
1122     gerrit_sonar_triggers:
1123       - comment-added-contains-event:
1124           comment-contains-value: '^Patch Set\s+\d+:\s+run-sonar\s*$'
1125
1126     #####################
1127     # Job Configuration #
1128     #####################
1129
1130     disabled: '{disable-job}'
1131
1132     parameters:
1133       - lf-infra-parameters:
1134           project: '{project}'
1135           branch: '{branch}'
1136           stream: '{stream}'
1137       - lf-infra-maven-parameters:
1138           mvn-opts: '{mvn-opts}'
1139           mvn-params: '{mvn-params}'
1140           mvn-version: '{mvn-version}'
1141       - string:
1142           name: ARCHIVE_ARTIFACTS
1143           default: '{archive-artifacts}'
1144           description: Artifacts to archive to the logs server.
1145       - string:
1146           name: SONAR_MAVEN_GOAL
1147           default: '{sonar-mvn-goal}'
1148           description: |
1149               Maven goals to pass to the Sonar call. Typically sonar:sonar
1150               however to use a specific version of the sonar-maven-plugin we
1151               can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
1152
1153     triggers:
1154       - timed: '{obj:cron}'
1155       - gerrit:
1156           server-name: '{gerrit-server-name}'
1157           trigger-on: '{obj:gerrit_sonar_triggers}'
1158           projects:
1159             - project-compare-type: 'ANT'
1160               project-pattern: '{project}'
1161               branches:
1162                 - branch-compare-type: 'ANT'
1163                   branch-pattern: '**/master'
1164           skip-vote:
1165             successful: true
1166             failed: true
1167             unstable: true
1168             notbuilt: true
1169
1170     builders:
1171       - lf-infra-pre-build
1172       # With SonarCloud
1173       - conditional-step:
1174           condition-kind: boolean-expression
1175           condition-expression: '{sonarcloud}'
1176           steps:
1177             - shell: echo 'Using SonarCloud'
1178             - lf-infra-maven-sonarcloud:
1179                 java-version: '{java-version}'
1180                 mvn-settings: '{mvn-settings}'
1181                 mvn-version: '{mvn-version}'
1182                 sonarcloud-project-key: '{sonarcloud-project-key}'
1183                 sonarcloud-project-organization: '{sonarcloud-project-organization}'
1184                 sonarcloud-api-token: '{sonarcloud-api-token}'
1185       # With SonarQube
1186       - conditional-step:
1187           condition-kind: not
1188           condition-operand:
1189             condition-kind: boolean-expression
1190             condition-expression: '{sonarcloud}'
1191           steps:
1192             - shell: echo 'Using SonarQube'
1193             - lf-infra-maven-sonar:
1194                 java-version: '{java-version}'
1195                 mvn-settings: '{mvn-settings}'
1196                 mvn-version: '{mvn-version}'
1197
1198     publishers:
1199       - lf-jacoco-report
1200       - findbugs
1201       - lf-infra-publish
1202
1203 - builder:
1204     name: lf-infra-maven-sonar
1205     # Run a Sonar build with Maven
1206     builders:
1207       - lf-maven-install:
1208           mvn-version: '{mvn-version}'
1209       - lf-update-java-alternatives:
1210           java-version: '{java-version}'
1211       - inject:
1212           # Switch this to the sonar wrapper when JJB 2.0 is available
1213           properties-content: SONAR_HOST_URL=$SONAR_URL
1214       - lf-provide-maven-settings:
1215           global-settings-file: global-settings
1216           settings-file: '{mvn-settings}'
1217       - shell: !include-raw-escape:
1218           - ../shell/common-variables.sh
1219           - ../shell/maven-sonar.sh
1220       - lf-provide-maven-settings-cleanup
1221
1222 - builder:
1223     name: lf-infra-maven-sonarcloud
1224     # Run a Sonar build with Maven
1225     builders:
1226       - lf-maven-install:
1227           mvn-version: '{mvn-version}'
1228       - lf-update-java-alternatives:
1229           java-version: '{java-version}'
1230       - inject:
1231           # Switch this to the sonar wrapper when JJB 2.0 is available
1232           properties-content: |
1233             SONAR_HOST_URL=https://sonarcloud.io
1234             PROJECT_KEY={sonarcloud-project-key}
1235             PROJECT_ORGANIZATION={sonarcloud-project-organization}
1236             API_TOKEN={sonarcloud-api-token}
1237       - lf-provide-maven-settings:
1238           global-settings-file: global-settings
1239           settings-file: '{mvn-settings}'
1240       - shell: !include-raw-escape:
1241           - ../shell/common-variables.sh
1242           - ../shell/maven-sonar.sh
1243       - lf-provide-maven-settings-cleanup
1244
1245 - job-template:
1246     name: '{project-name}-sonar'
1247     id: gerrit-maven-sonar
1248     <<: *lf_maven_common
1249     # yamllint disable-line rule:key-duplicates
1250     <<: *lf_maven_sonar
1251
1252     scm:
1253       - lf-infra-gerrit-scm:
1254           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1255           git-url: '{git-url}'
1256           refspec: $GERRIT_REFSPEC
1257           branch: $GERRIT_BRANCH
1258           submodule-recursive: '{submodule-recursive}'
1259           submodule-timeout: '{submodule-timeout}'
1260           submodule-disable: '{submodule-disable}'
1261           choosing-strategy: default
1262
1263 - job-template:
1264     name: '{project-name}-sonar'
1265     id: github-maven-sonar
1266     <<: *lf_maven_common
1267     # yamllint disable-line rule:key-duplicates
1268     <<: *lf_maven_sonar
1269
1270     properties:
1271       - lf-infra-properties:
1272           build-days-to-keep: '{build-days-to-keep}'
1273       - github:
1274           url: '{github-url}/{github-org}/{project}'
1275
1276     scm:
1277       - lf-infra-github-scm:
1278           url: '{git-clone-url}{github-org}/{project}'
1279           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1280           branch: '$sha1'
1281           submodule-recursive: '{submodule-recursive}'
1282           submodule-timeout: '{submodule-timeout}'
1283           submodule-disable: '{submodule-disable}'
1284           choosing-strategy: default
1285           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1286
1287     triggers:
1288       - timed: '{obj:cron}'
1289       - github-pull-request:
1290           trigger-phrase: '^run-sonar$'
1291           only-trigger-phrase: true
1292           status-context: 'Maven Sonar'
1293           permit-all: true
1294           github-hooks: true
1295           org-list:
1296             - '{github-org}'
1297           white-list: '{obj:github_pr_whitelist}'
1298           admin-list: '{obj:github_pr_admin_list}'
1299           white-list-target-branches:
1300             - '{branch}'
1301
1302 ################
1303 # Maven Verify #
1304 ################
1305
1306 - lf_maven_verify: &lf_maven_verify
1307     name: lf-maven-verify
1308
1309     ######################
1310     # Default parameters #
1311     ######################
1312
1313     branch: master
1314     build-days-to-keep: 7
1315     build-timeout: 60
1316     disable-job: false
1317     git-url: '$GIT_URL/$PROJECT'
1318     github-url: 'https://github.com'
1319     java-version: openjdk8
1320     mvn-global-settings: global-settings
1321     mvn-goals: clean deploy
1322     mvn-opts: ''
1323     mvn-params: '-Dstream=$STREAM -Dmaven.source.skip=true'
1324     mvn-version: mvn35
1325     stream: master
1326     submodule-recursive: true
1327     submodule-timeout: 10
1328     submodule-disable: false
1329
1330     gerrit_verify_triggers:
1331       - patchset-created-event:
1332           exclude-drafts: true
1333           exclude-trivial-rebase: false
1334           exclude-no-code-change: false
1335       - draft-published-event
1336       - comment-added-contains-event:
1337           comment-contains-value: '^Patch Set\s+\d+:\s+(recheck|reverify)\s*$'
1338
1339     gerrit_trigger_file_paths:
1340       - compare-type: REG_EXP
1341         pattern: '.*'
1342
1343     # github_included_regions MUST match gerrit_trigger_file_paths
1344     github_included_regions:
1345       - '.*'
1346
1347     #####################
1348     # Job Configuration #
1349     #####################
1350
1351     concurrent: true
1352     disabled: '{disable-job}'
1353
1354     builders:
1355       - lf-infra-pre-build
1356       - lf-jacoco-nojava-workaround
1357       - lf-maven-install:
1358           mvn-version: '{mvn-version}'
1359       - lf-update-java-alternatives:
1360           java-version: '{java-version}'
1361       - lf-provide-maven-settings:
1362           global-settings-file: '{mvn-global-settings}'
1363           settings-file: '{mvn-settings}'
1364       - lf-maven-build:
1365           mvn-goals: '{mvn-goals}'
1366       - lf-provide-maven-settings-cleanup
1367
1368     publishers:
1369       - findbugs
1370       - lf-jacoco-report
1371       - lf-infra-publish
1372
1373 - job-template:
1374     name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
1375     id: gerrit-maven-verify
1376     <<: *lf_maven_common
1377     # yamllint disable-line rule:key-duplicates
1378     <<: *lf_maven_verify
1379
1380     scm:
1381       - lf-infra-gerrit-scm:
1382           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1383           git-url: '{git-url}'
1384           refspec: '$GERRIT_REFSPEC'
1385           branch: '$GERRIT_BRANCH'
1386           submodule-recursive: '{submodule-recursive}'
1387           submodule-timeout: '{submodule-timeout}'
1388           submodule-disable: '{submodule-disable}'
1389           choosing-strategy: gerrit
1390
1391     triggers:
1392       - gerrit:
1393           server-name: '{gerrit-server-name}'
1394           trigger-on: '{obj:gerrit_verify_triggers}'
1395           projects:
1396             - project-compare-type: ANT
1397               project-pattern: '{project}'
1398               branches:
1399                 - branch-compare-type: ANT
1400                   branch-pattern: '**/{branch}'
1401               file-paths: '{obj:gerrit_trigger_file_paths}'
1402
1403 - job-template:
1404     name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
1405     id: github-maven-verify
1406     <<: *lf_maven_common
1407     # yamllint disable-line rule:key-duplicates
1408     <<: *lf_maven_verify
1409
1410     properties:
1411       - lf-infra-properties:
1412           build-days-to-keep: '{build-days-to-keep}'
1413       - github:
1414           url: '{github-url}/{github-org}/{project}'
1415
1416     scm:
1417       - lf-infra-github-scm:
1418           url: '{git-clone-url}{github-org}/{project}'
1419           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1420           branch: '$sha1'
1421           submodule-recursive: '{submodule-recursive}'
1422           submodule-timeout: '{submodule-timeout}'
1423           submodule-disable: '{submodule-disable}'
1424           choosing-strategy: default
1425           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1426
1427     triggers:
1428       - github-pull-request:
1429           trigger-phrase: '^(recheck|reverify)$'
1430           only-trigger-phrase: false
1431           status-context: 'Maven Verify {mvn-version}-{java-version}'
1432           permit-all: true
1433           github-hooks: true
1434           white-list-target-branches:
1435             - '{branch}'
1436           included-regions: '{obj:github_included_regions}'
1437
1438 ###########################
1439 # Maven Verify for Docker #
1440 ###########################
1441
1442 - lf_maven_docker_verify: &lf_maven_docker_verify
1443     name: lf-maven-docker-verify
1444
1445     # image push not allowed during verification
1446     mvn-goals: clean install
1447
1448     builders:
1449       - lf-infra-pre-build
1450       - lf-jacoco-nojava-workaround
1451       - lf-maven-install:
1452           mvn-version: '{mvn-version}'
1453       - lf-update-java-alternatives:
1454           java-version: '{java-version}'
1455       - lf-infra-docker-login:
1456           global-settings-file: '{mvn-global-settings}'
1457           settings-file: '{mvn-settings}'
1458       # must provide maven settings AFTER docker due to its cleanup
1459       - lf-provide-maven-settings:
1460           global-settings-file: '{mvn-global-settings}'
1461           settings-file: '{mvn-settings}'
1462       - inject:
1463           properties-content: |
1464               CONTAINER_PULL_REGISTRY={container-public-registry}
1465       - lf-maven-build:
1466           mvn-goals: '{mvn-goals}'
1467       - lf-provide-maven-settings-cleanup
1468
1469 - job-template:
1470     name: '{project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}'
1471     id: gerrit-maven-docker-verify
1472     <<: *lf_maven_common
1473     # yamllint disable-line rule:key-duplicates
1474     <<: *lf_maven_verify
1475     # yamllint disable-line rule:key-duplicates
1476     <<: *lf_maven_docker_verify
1477
1478     scm:
1479       - lf-infra-gerrit-scm:
1480           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1481           git-url: '{git-url}'
1482           refspec: '$GERRIT_REFSPEC'
1483           branch: '$GERRIT_BRANCH'
1484           submodule-recursive: '{submodule-recursive}'
1485           submodule-timeout: '{submodule-timeout}'
1486           submodule-disable: '{submodule-disable}'
1487           choosing-strategy: gerrit
1488
1489     triggers:
1490       - gerrit:
1491           server-name: '{gerrit-server-name}'
1492           trigger-on: '{obj:gerrit_verify_triggers}'
1493           projects:
1494             - project-compare-type: ANT
1495               project-pattern: '{project}'
1496               branches:
1497                 - branch-compare-type: ANT
1498                   branch-pattern: '**/{branch}'
1499               file-paths: '{obj:gerrit_trigger_file_paths}'
1500
1501 - job-template:
1502     name: '{project-name}-maven-docker-verify-{stream}-{mvn-version}-{java-version}'
1503     id: github-maven-docker-verify
1504     <<: *lf_maven_common
1505     # yamllint disable-line rule:key-duplicates
1506     <<: *lf_maven_verify
1507     # yamllint disable-line rule:key-duplicates
1508     <<: *lf_maven_docker_verify
1509
1510     properties:
1511       - lf-infra-properties:
1512           build-days-to-keep: '{build-days-to-keep}'
1513       - github:
1514           url: '{github-url}/{github-org}/{project}'
1515
1516     scm:
1517       - lf-infra-github-scm:
1518           url: '{git-clone-url}{github-org}/{project}'
1519           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
1520           branch: '$sha1'
1521           submodule-recursive: '{submodule-recursive}'
1522           submodule-timeout: '{submodule-timeout}'
1523           submodule-disable: '{submodule-disable}'
1524           choosing-strategy: default
1525           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1526
1527     triggers:
1528       - github-pull-request:
1529           trigger-phrase: '^(recheck|reverify)$'
1530           only-trigger-phrase: false
1531           status-context: 'Maven Docker Verify {mvn-version}-{java-version}'
1532           permit-all: true
1533           github-hooks: true
1534           white-list-target-branches:
1535             - '{branch}'
1536           included-regions: '{obj:github_included_regions}'
1537
1538 #############################
1539 # Maven Verify Dependencies #
1540 #############################
1541
1542 - lf_maven_verify_dependencies: &lf_maven_verify_dependencies
1543     name: lf-maven-verify-dependencies
1544
1545     ######################
1546     # Default parameters #
1547     ######################
1548
1549     branch: master
1550     build-days-to-keep: 7
1551     build-timeout: 60
1552     disable-job: false
1553     git-url: '$GIT_URL/$PROJECT'
1554     github-url: 'https://github.com'
1555     java-version: openjdk8
1556     mvn-global-settings: global-settings
1557     mvn-goals: clean deploy
1558     mvn-opts: ''
1559     mvn-params: '-Dstream=$STREAM'
1560     mvn-version: mvn35
1561     stream: master
1562     submodule-recursive: true
1563     submodule-timeout: 10
1564     submodule-disable: false
1565
1566     gerrit_verify_triggers:
1567       - comment-added-contains-event:
1568           comment-contains-value: 'recheck: [0-9 ]+'
1569     gerrit_trigger_file_paths:
1570       - compare-type: ANT
1571         pattern: '**'
1572
1573     #####################
1574     # Job Configuration #
1575     #####################
1576
1577     concurrent: true
1578     disabled: '{disable-job}'
1579
1580     builders:
1581       - lf-infra-pre-build
1582       - lf-jacoco-nojava-workaround
1583       - lf-maven-install:
1584           mvn-version: '{mvn-version}'
1585       - lf-update-java-alternatives:
1586           java-version: '{java-version}'
1587       - lf-provide-maven-settings:
1588           global-settings-file: '{mvn-global-settings}'
1589           settings-file: '{mvn-settings}'
1590       - lf-fetch-dependent-patches
1591       - shell: !include-raw-escape:
1592           - ../shell/common-variables.sh
1593           - ../shell/maven-build-deps.sh
1594       - lf-maven-build:
1595           mvn-goals: '{mvn-goals}'
1596       - lf-provide-maven-settings-cleanup
1597
1598     publishers:
1599       - findbugs
1600       - lf-jacoco-report
1601       - lf-infra-publish
1602
1603 - job-template:
1604     name: '{project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}'
1605     id: gerrit-maven-verify-dependencies
1606     <<: *lf_maven_common
1607     # yamllint disable-line rule:key-duplicates
1608     <<: *lf_maven_verify_dependencies
1609
1610     scm:
1611       - lf-infra-gerrit-scm:
1612           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1613           git-url: '{git-url}'
1614           refspec: '$GERRIT_REFSPEC'
1615           branch: '$GERRIT_BRANCH'
1616           submodule-recursive: '{submodule-recursive}'
1617           submodule-timeout: '{submodule-timeout}'
1618           submodule-disable: '{submodule-disable}'
1619           choosing-strategy: gerrit
1620
1621     triggers:
1622       - gerrit:
1623           server-name: '{gerrit-server-name}'
1624           trigger-on: '{obj:gerrit_verify_triggers}'
1625           projects:
1626             - project-compare-type: ANT
1627               project-pattern: '{project}'
1628               branches:
1629                 - branch-compare-type: ANT
1630                   branch-pattern: '**/{branch}'
1631               file-paths: '{obj:gerrit_trigger_file_paths}'