26451a457ec93483a1b368ee90d3bcfc34f361a5
[releng/global-jjb.git] / lf-maven-jobs.yaml
1 ---
2 # This file contains job templates for Maven projects.
3
4 - job-group:
5     name: '{project-name}-maven-jobs'
6
7     # This job group contains all the recommended jobs that should be deployed
8     # for any project ci.
9
10     # TODO: Add Maven Merge job to this list once it's been fully tested.
11     jobs:
12       - gerrit-maven-clm
13       - gerrit-maven-merge
14       - gerrit-maven-release
15       - gerrit-maven-verify
16       - gerrit-maven-verify-dependencies
17
18 - job-group:
19     name: '{project-name}-github-maven-jobs'
20
21     # This job group contains all the recommended jobs that should be deployed
22     # for any project ci that is using github.
23
24     # TODO: Add Maven Merge job to this list once it's been fully tested.
25     jobs:
26       - github-maven-clm
27       - github-maven-merge
28       - github-maven-release
29       - github-maven-verify
30
31 - job-group:
32     name: '{project-name}-maven-javadoc-jobs'
33
34     # This job group contains all the recommended jobs that should be deployed
35     # for any project ci.
36
37     jobs:
38       - gerrit-maven-javadoc-publish
39       - gerrit-maven-javadoc-verify
40
41 - job-group:
42     name: '{project-name}-github-maven-javadoc-jobs'
43
44     # This job group contains all the recommended jobs that should be deployed
45     # for any project ci.
46
47     jobs:
48       - github-maven-javadoc-publish
49       - github-maven-javadoc-verify
50
51 ####################
52 # COMMON FUNCTIONS #
53 ####################
54
55 - lf_maven_common: &lf_maven_common
56     name: lf-maven-common
57
58     ######################
59     # Default parameters #
60     ######################
61
62     archive-artifacts: >
63       **/*.log
64       **/hs_err_*.log
65       **/target/**/feature.xml
66       **/target/failsafe-reports/failsafe-summary.xml
67       **/target/surefire-reports/*-output.txt
68
69     #####################
70     # Job Configuration #
71     #####################
72
73     project-type: freestyle
74     node: '{build-node}'
75     jdk: '{java-version}'
76
77     properties:
78       - lf-infra-properties:
79           build-days-to-keep: '{build-days-to-keep}'
80
81     parameters:
82       - lf-infra-parameters:
83           project: '{project}'
84           branch: '{branch}'
85           stream: '{stream}'
86           lftools-version: '{lftools-version}'
87       - lf-infra-maven-parameters:
88           mvn-opts: '{mvn-opts}'
89           mvn-params: '{mvn-params}'
90           mvn-version: '{mvn-version}'
91           # Staging repos do not make sense for CLM jobs so set it blank.
92           staging-profile-id: '{staging-profile-id}'
93       - string:
94           name: ARCHIVE_ARTIFACTS
95           default: '{archive-artifacts}'
96           description: Artifacts to archive to the logs server.
97
98     wrappers:
99       - lf-infra-wrappers:
100           build-timeout: '{build-timeout}'
101           jenkins-ssh-credential: '{jenkins-ssh-credential}'
102
103     publishers:
104       # TODO: Make email notification work.
105       # - lf-infra-email-notify:
106       #     email-recipients: '{email-recipients}'
107       #     email-prefix: '[releng]'
108       - lf-infra-publish
109
110 #############
111 # Maven CLM #
112 #############
113
114 - lf_maven_clm: &lf_maven_clm
115     name: lf-maven-clm
116
117     ######################
118     # Default parameters #
119     ######################
120
121     branch: master
122     build-days-to-keep: 30  # 30 days for troubleshooting purposes
123     build-timeout: 60
124     git-url: '$GIT_URL/$PROJECT'
125     java-version: openjdk8
126     mvn-global-settings: global-settings
127     mvn-opts: ''
128     mvn-params: ''
129     mvn-version: mvn33
130     staging-profile-id: ''  # Unused in this job
131     stream: master
132     submodule-recursive: true
133
134     gerrit_clm_triggers:
135       - comment-added-contains-event:
136           comment-contains-value: run-clm$
137
138     #####################
139     # Job Configuration #
140     #####################
141
142     triggers:
143       # Build weekly on Saturdays
144       - timed: 'H H * * 6'
145       - gerrit:
146           server-name: '{gerrit-server-name}'
147           trigger-on: '{obj:gerrit_clm_triggers}'
148           projects:
149             - project-compare-type: ANT
150               project-pattern: '{project}'
151               branches:
152                 - branch-compare-type: ANT
153                   branch-pattern: '**/{branch}'
154           skip-vote:
155             successful: true
156             failed: true
157             unstable: true
158             notbuilt: true
159
160     builders:
161       - lf-maven-install:
162           mvn-version: '{mvn-version}'
163       - lf-provide-maven-settings:
164           global-settings-file: '{mvn-global-settings}'
165           settings-file: '{mvn-settings}'
166       - shell: !include-raw-escape:
167           - ../shell/common-variables.sh
168           - ../shell/sonatype-clm.sh
169       - lf-provide-maven-settings-cleanup
170       - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
171       - sonatype-clm:
172           application-name: '{project-name}'
173
174 - job-template:
175     name: '{project-name}-maven-clm-{stream}'
176     id: gerrit-maven-clm
177     <<: *lf_maven_common
178     # yamllint disable-line rule:key-duplicates
179     <<: *lf_maven_clm
180
181     scm:
182       - lf-infra-gerrit-scm:
183           jenkins-ssh-credential: '{jenkins-ssh-credential}'
184           git-url: '{git-url}'
185           refspec: '$GERRIT_REFSPEC'
186           branch: '$GERRIT_BRANCH'
187           submodule-recursive: '{submodule-recursive}'
188           choosing-strategy: default
189
190 - job-template:
191     name: '{project-name}-maven-clm-{stream}'
192     id: github-maven-clm
193     <<: *lf_maven_common
194     # yamllint disable-line rule:key-duplicates
195     <<: *lf_maven_clm
196
197     properties:
198       - github:
199           url: '{git-url}/{github-org}/{project}'
200
201     scm:
202       - lf-infra-github-scm:
203           url: '{git-clone-url}{github-org}/{project}'
204           refspec: ''
205           branch: 'refs/heads/{branch}'
206           submodule-recursive: '{submodule-recursive}'
207           choosing-strategy: default
208           jenkins-ssh-credential: '{jenkins-ssh-credential}'
209
210     triggers:
211       - lf-infra-github-pr-trigger:
212           trigger-phrase: '^run-clm$'
213           only-trigger-phrase: false
214           status-context: 'CLM'
215           permit-all: true
216           github-hooks: true
217           github-org: ''
218           github_pr_whitelist:
219             - ''
220           github_pr_admin_list:
221             - ''
222
223 #########################
224 # Maven Javadoc Publish #
225 #########################
226
227 - lf_maven_javadoc_publish: &lf_maven_javadoc_publish
228     name: lf-maven-javadoc-publish
229
230     ######################
231     # Default parameters #
232     ######################
233
234     branch: master
235     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
236     build-timeout: 60
237     git-url: '$GIT_URL/$PROJECT'
238     java-version: openjdk8
239     mvn-global-settings: global-settings
240     mvn-opts: ''
241     mvn-params: ''
242     mvn-version: mvn33
243     staging-profile-id: ''  # Unused by the javadoc jobs
244     stream: master
245     submodule-recursive: true
246
247     gerrit_merge_triggers:
248       - change-merged-event
249       - comment-added-contains-event:
250           comment-contains-value: remerge$
251
252     #####################
253     # Job Configuration #
254     #####################
255
256     builders:
257       - lf-maven-install:
258           mvn-version: '{mvn-version}'
259       - lf-provide-maven-settings:
260           global-settings-file: '{mvn-global-settings}'
261           settings-file: '{mvn-settings}'
262       - lf-infra-create-netrc:
263           server-id: '{mvn-site-id}'
264       - inject:
265           properties-content: 'DEPLOY_PATH={javadoc-path}'
266       - shell: !include-raw-escape:
267           - ../shell/common-variables.sh
268           - ../shell/maven-javadoc-generate.sh
269           - ../shell/lftools-install.sh
270           - ../shell/maven-javadoc-publish.sh
271       - lf-provide-maven-settings-cleanup
272
273 - job-template:
274     name: '{project-name}-maven-javadoc-publish-{stream}'
275     id: gerrit-maven-javadoc-publish
276     <<: *lf_maven_common
277     # yamllint disable-line rule:key-duplicates
278     <<: *lf_maven_javadoc_publish
279
280     git-url: '$GIT_URL/$GERRIT_PROJECT'
281
282     scm:
283       - lf-infra-gerrit-scm:
284           git-url: '{git-url}'
285           refspec: ''
286           branch: '{branch}'
287           submodule-recursive: '{submodule-recursive}'
288           choosing-strategy: default
289           jenkins-ssh-credential: '{jenkins-ssh-credential}'
290
291     triggers:
292       - gerrit:
293           server-name: '{gerrit-server-name}'
294           trigger-on: '{obj:gerrit_merge_triggers}'
295           projects:
296             - project-compare-type: ANT
297               project-pattern: '{project}'
298               branches:
299                 - branch-compare-type: ANT
300                   branch-pattern: '**/{branch}'
301
302 - job-template:
303     name: '{project-name}-maven-javadoc-publish-{stream}'
304     id: github-maven-javadoc-publish
305     <<: *lf_maven_common
306     # yamllint disable-line rule:key-duplicates
307     <<: *lf_maven_javadoc_publish
308
309     properties:
310       - github:
311           url: '{git-url}/{github-org}/{project}'
312
313     scm:
314       - lf-infra-github-scm:
315           url: '{git-clone-url}{github-org}/{project}'
316           refspec: ''
317           branch: '{branch}'
318           submodule-recursive: '{submodule-recursive}'
319           choosing-strategy: default
320           jenkins-ssh-credential: '{jenkins-ssh-credential}'
321
322     triggers:
323       - github
324       - pollscm:
325           cron: ''
326       - lf-infra-github-pr-trigger:
327           trigger-phrase: '^remerge$'
328           only-trigger-phrase: true
329           status-context: 'JJB Merge'
330           permit-all: false
331           github-hooks: true
332           github-org: '{github-org}'
333           github_pr_whitelist: '{obj:github_pr_whitelist}'
334           github_pr_admin_list: '{obj:github_pr_admin_list}'
335
336 ########################
337 # Maven Javadoc Verify #
338 ########################
339
340 - lf_maven_javadoc_verify: &lf_maven_javadoc_verify
341     name: lf-maven-javadoc-verify
342
343     ######################
344     # Default parameters #
345     ######################
346
347     branch: master
348     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
349     build-timeout: 60
350     git-url: '$GIT_URL/$PROJECT'
351     java-version: openjdk8
352     mvn-global-settings: global-settings
353     mvn-opts: ''
354     mvn-params: ''
355     mvn-version: mvn33
356     staging-profile-id: ''  # Unused by the javadoc jobs
357     stream: master
358     submodule-recursive: true
359
360     gerrit_verify_triggers:
361       - patchset-created-event:
362           exclude-drafts: true
363           exclude-trivial-rebase: false
364           exclude-no-code-change: false
365       - draft-published-event
366       - comment-added-contains-event:
367           comment-contains-value: recheck$
368
369     #####################
370     # Job Configuration #
371     #####################
372
373     concurrent: true
374
375     builders:
376       - lf-maven-install:
377           mvn-version: '{mvn-version}'
378       - lf-provide-maven-settings:
379           global-settings-file: '{mvn-global-settings}'
380           settings-file: '{mvn-settings}'
381       - shell: !include-raw-escape:
382           - ../shell/common-variables.sh
383           - ../shell/maven-javadoc-generate.sh
384       - lf-provide-maven-settings-cleanup
385
386 - job-template:
387     name: '{project-name}-maven-javadoc-verify-{stream}'
388     id: gerrit-maven-javadoc-verify
389     <<: *lf_maven_common
390     # yamllint disable-line rule:key-duplicates
391     <<: *lf_maven_javadoc_verify
392
393     scm:
394       - lf-infra-gerrit-scm:
395           jenkins-ssh-credential: '{jenkins-ssh-credential}'
396           git-url: '{git-url}'
397           refspec: '$GERRIT_REFSPEC'
398           branch: '$GERRIT_BRANCH'
399           submodule-recursive: '{submodule-recursive}'
400           choosing-strategy: gerrit
401
402     triggers:
403       - gerrit:
404           server-name: '{gerrit-server-name}'
405           trigger-on: '{obj:gerrit_verify_triggers}'
406           projects:
407             - project-compare-type: ANT
408               project-pattern: '{project}'
409               branches:
410                 - branch-compare-type: ANT
411                   branch-pattern: '**/{branch}'
412
413 - job-template:
414     name: '{project-name}-maven-javadoc-verify-{stream}'
415     id: github-maven-javadoc-verify
416     <<: *lf_maven_common
417     # yamllint disable-line rule:key-duplicates
418     <<: *lf_maven_javadoc_verify
419
420     properties:
421       - github:
422           url: '{git-url}/{github-org}/{project}'
423
424     scm:
425       - lf-infra-github-scm:
426           url: '{git-clone-url}{github-org}/{project}'
427           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
428           branch: '$sha1'
429           submodule-recursive: '{submodule-recursive}'
430           choosing-strategy: default
431           jenkins-ssh-credential: '{jenkins-ssh-credential}'
432
433     triggers:
434       - lf-infra-github-pr-trigger:
435           trigger-phrase: '^recheck$'
436           only-trigger-phrase: true
437           status-context: 'Maven Javadoc'
438           permit-all: true
439           github-hooks: true
440           github-org: ''
441           github_pr_whitelist:
442             - ''
443           github_pr_admin_list:
444             - ''
445
446 ###############
447 # Maven Merge #
448 ###############
449
450 - lf_maven_merge: &lf_maven_merge
451     name: lf-maven-merge
452
453     ######################
454     # Default parameters #
455     ######################
456
457     branch: master
458     build-days-to-keep: 30  # 30 days in case we need to troubleshoot
459     build-timeout: 60
460     cron: ''
461     git-url: '$GIT_URL/$PROJECT'
462     java-version: openjdk8
463     mvn-global-settings: global-settings
464     mvn-opts: ''
465     mvn-params: '-Dmerge'
466     mvn-version: mvn33
467     nexus-cut-dirs: 6  # Number of dirs in the Nexus path to remove for wget -r.
468     staging-profile-id: ''  # Unused by this job.
469     stream: master
470     submodule-recursive: true
471
472     gerrit_merge_triggers:
473       - change-merged-event
474       - comment-added-contains-event:
475           comment-contains-value: remerge$
476
477     gerrit_trigger_file_paths:
478       - compare-type: ANT
479         pattern: '**'
480
481     post_build_trigger: ''
482
483     #####################
484     # Job Configuration #
485     #####################
486
487     builders:
488       - lf-jacoco-nojava-workaround
489       - lf-maven-install:
490           mvn-version: '{mvn-version}'
491       - lf-provide-maven-settings:
492           global-settings-file: '{mvn-global-settings}'
493           settings-file: '{mvn-settings}'
494       - lf-infra-create-netrc:
495           server-id: '{mvn-snapshot-id}'
496       - inject:
497           properties-content: |
498               NEXUS_CUT_DIRS={nexus-cut-dirs}
499               NEXUS_REPO={nexus-snapshot-repo}
500       - shell: !include-raw-escape:
501           - ../shell/lftools-install.sh
502           - ../shell/common-variables.sh
503           - ../shell/maven-fetch-metadata.sh
504           - ../shell/maven-build.sh
505           - ../shell/maven-deploy.sh
506       - lf-provide-maven-settings-cleanup
507
508     publishers:
509       - findbugs
510       - lf-jacoco-report
511       - lf-infra-publish
512       - trigger-parameterized-builds: '{obj:post_build_trigger}'
513
514 - job-template:
515     name: '{project-name}-maven-merge-{stream}'
516     id: gerrit-maven-merge
517     <<: *lf_maven_common
518     # yamllint disable-line rule:key-duplicates
519     <<: *lf_maven_merge
520
521     scm:
522       - lf-infra-gerrit-scm:
523           jenkins-ssh-credential: '{jenkins-ssh-credential}'
524           git-url: '{git-url}'
525           refspec: '$GERRIT_REFSPEC'
526           branch: '$GERRIT_BRANCH'
527           submodule-recursive: '{submodule-recursive}'
528           choosing-strategy: default
529
530     triggers:
531       - timed: 'H H * * 0'
532       - gerrit:
533           server-name: '{gerrit-server-name}'
534           trigger-on: '{obj:gerrit_merge_triggers}'
535           projects:
536             - project-compare-type: ANT
537               project-pattern: '{project}'
538               branches:
539                 - branch-compare-type: ANT
540                   branch-pattern: '**/{branch}'
541               file-paths: '{obj:gerrit_trigger_file_paths}'
542
543 - job-template:
544     name: '{project-name}-maven-merge-{stream}'
545     id: github-maven-merge
546     <<: *lf_maven_common
547     # yamllint disable-line rule:key-duplicates
548     <<: *lf_maven_merge
549
550     properties:
551       - github:
552           url: '{git-url}/{github-org}/{project}'
553
554     scm:
555       - lf-infra-github-scm:
556           url: '{git-clone-url}{github-org}/{project}'
557           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
558           branch: '{branch}'
559           submodule-recursive: '{submodule-recursive}'
560           choosing-strategy: default
561           jenkins-ssh-credential: '{jenkins-ssh-credential}'
562
563     triggers:
564       - lf-infra-github-pr-trigger:
565           trigger-phrase: '^remerge$'
566           only-trigger-phrase: false
567           status-context: 'Maven Merge'
568           permit-all: true
569           github-hooks: true
570           github-org: ''
571           github_pr_whitelist:
572             - ''
573           github_pr_admin_list:
574             - ''
575
576 #################
577 # Maven Release #
578 #################
579
580 - lf_maven_release: &lf_maven_release
581     name: lf-maven-release
582
583     ######################
584     # Default parameters #
585     ######################
586
587     branch: master
588     build-days-to-keep: 30  # 30 days in case a release takes long to get approved.
589     build-timeout: 60
590     cron: ''
591     git-url: '$GIT_URL/$PROJECT'
592     java-version: openjdk8
593     mvn-global-settings: global-settings
594     mvn-opts: ''
595     mvn-params: ''
596     mvn-version: mvn33
597     stream: master
598     submodule-recursive: true
599
600     gerrit_release_triggers:
601       - comment-added-contains-event:
602           comment-contains-value: build release$
603
604     #####################
605     # Job Configuration #
606     #####################
607
608     builders:
609       - lf-jacoco-nojava-workaround
610       - lf-maven-install:
611           mvn-version: '{mvn-version}'
612       - lf-provide-maven-settings:
613           global-settings-file: '{mvn-global-settings}'
614           settings-file: '{mvn-settings}'
615       - lf-infra-create-netrc:
616           server-id: '{mvn-staging-id}'
617       - shell: !include-raw-escape:
618           - ../shell/lftools-install.sh
619           - ../shell/common-variables.sh
620           - ../shell/maven-patch-release.sh
621           - ../shell/maven-build.sh
622           - ../shell/maven-stage.sh
623       - lf-provide-maven-settings-cleanup
624
625 - job-template:
626     name: '{project-name}-maven-release-{stream}'
627     id: gerrit-maven-release
628     <<: *lf_maven_common
629     # yamllint disable-line rule:key-duplicates
630     <<: *lf_maven_release
631
632     scm:
633       - lf-infra-gerrit-scm:
634           jenkins-ssh-credential: '{jenkins-ssh-credential}'
635           git-url: '{git-url}'
636           refspec: '$GERRIT_REFSPEC'
637           branch: '$GERRIT_BRANCH'
638           submodule-recursive: '{submodule-recursive}'
639           choosing-strategy: default
640
641     triggers:
642       - timed: '{obj:cron}'
643       - gerrit:
644           server-name: '{gerrit-server-name}'
645           trigger-on: '{obj:gerrit_release_triggers}'
646           projects:
647             - project-compare-type: ANT
648               project-pattern: '{project}'
649               branches:
650                 - branch-compare-type: ANT
651                   branch-pattern: '**/{branch}'
652
653 - job-template:
654     name: '{project-name}-maven-release-{stream}'
655     id: github-maven-release
656     <<: *lf_maven_common
657     # yamllint disable-line rule:key-duplicates
658     <<: *lf_maven_release
659
660     properties:
661       - github:
662           url: '{git-url}/{github-org}/{project}'
663
664     scm:
665       - lf-infra-github-scm:
666           url: '{git-clone-url}{github-org}/{project}'
667           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
668           branch: '{branch}'
669           submodule-recursive: '{submodule-recursive}'
670           choosing-strategy: default
671           jenkins-ssh-credential: '{jenkins-ssh-credential}'
672
673     triggers:
674       - timed: '{obj:cron}'
675       - lf-infra-github-pr-trigger:
676           trigger-phrase: '^build release$'
677           only-trigger-phrase: true
678           status-context: 'Maven Release'
679           permit-all: true
680           github-hooks: true
681           github-org: ''
682           github_pr_whitelist:
683             - ''
684           github_pr_admin_list:
685             - ''
686
687 ###############
688 # Maven Sonar #
689 ###############
690
691 - lf_maven_sonar: &lf_maven_sonar
692     name: lf-maven-sonar
693
694     ######################
695     # Default parameters #
696     ######################
697
698     branch: master  # Sonar should always be run on master branch
699     build-days-to-keep: 7
700     build-timeout: 60
701     git-url: '$GIT_URL/$PROJECT'
702     java-version: openjdk8
703     mvn-global-settings: global-settings
704     mvn-opts: ''
705     mvn-params: ''
706     mvn-version: mvn33
707     sonar-mvn-goal: 'sonar:sonar'
708     staging-profile-id: ''  # Unused in this job
709     stream: master
710     submodule-recursive: true
711
712     gerrit_sonar_triggers:
713       - comment-added-contains-event:
714           comment-contains-value: run-sonar$
715
716     #####################
717     # Job Configuration #
718     #####################
719
720     parameters:
721       - lf-infra-parameters:
722           project: '{project}'
723           branch: '{branch}'
724           stream: '{stream}'
725           lftools-version: '{lftools-version}'
726       - lf-infra-maven-parameters:
727           mvn-opts: '{mvn-opts}'
728           mvn-params: '{mvn-params}'
729           mvn-version: '{mvn-version}'
730           # Staging repos do not make sense for Sonar jobs so set it blank.
731           staging-profile-id: ''
732       - string:
733           name: ARCHIVE_ARTIFACTS
734           default: '{archive-artifacts}'
735           description: Artifacts to archive to the logs server.
736       - string:
737           name: SONAR_MAVEN_GOAL
738           default: '{sonar-mvn-goal}'
739           description: |
740               Maven goals to pass to the Sonar call. Typically sonar:sonar
741               however to use a specific version of the sonar-maven-plugin we
742               can call "org.codehaus.mojo:sonar-maven-plugin:3.3.0.603:sonar".
743
744     triggers:
745       - timed: 'H H * * 6'
746       - gerrit:
747           server-name: '{gerrit-server-name}'
748           trigger-on: '{obj:gerrit_sonar_triggers}'
749           projects:
750             - project-compare-type: 'ANT'
751               project-pattern: '{project}'
752               branches:
753                 - branch-compare-type: 'ANT'
754                   branch-pattern: '**/master'
755           skip-vote:
756             successful: true
757             failed: true
758             unstable: true
759             notbuilt: true
760
761     builders:
762       - lf-infra-maven-sonar:
763           mvn-settings: '{mvn-settings}'
764           mvn-version: '{mvn-version}'
765
766     publishers:
767       - lf-jacoco-report
768       - findbugs
769       - lf-infra-publish
770
771 - builder:
772     name: lf-infra-maven-sonar
773     # Run a Sonar build with Maven
774     builders:
775       - lf-maven-install:
776           mvn-version: '{mvn-version}'
777       - inject:
778           # Switch this to the sonar wrapper when JJB 2.0 is available
779           properties-content: SONAR_HOST_URL=$SONAR_URL
780       - lf-provide-maven-settings:
781           global-settings-file: global-settings
782           settings-file: '{mvn-settings}'
783       - shell: !include-raw-escape:
784           - ../shell/common-variables.sh
785           - ../shell/maven-sonar.sh
786       - lf-provide-maven-settings-cleanup
787
788 - job-template:
789     name: '{project-name}-sonar'
790     id: gerrit-maven-sonar
791     <<: *lf_maven_common
792     # yamllint disable-line rule:key-duplicates
793     <<: *lf_maven_sonar
794
795     scm:
796       - lf-infra-gerrit-scm:
797           jenkins-ssh-credential: '{jenkins-ssh-credential}'
798           git-url: '{git-url}'
799           refspec: $GERRIT_REFSPEC
800           branch: $GERRIT_BRANCH
801           submodule-recursive: '{submodule-recursive}'
802           choosing-strategy: default
803
804 - job-template:
805     name: '{project-name}-sonar'
806     id: github-maven-sonar
807     <<: *lf_maven_common
808     # yamllint disable-line rule:key-duplicates
809     <<: *lf_maven_sonar
810
811     properties:
812       - github:
813           url: '{git-url}/{github-org}/{project}'
814
815     scm:
816       - lf-infra-github-scm:
817           url: '{git-clone-url}{github-org}/{project}'
818           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
819           branch: '$sha1'
820           submodule-recursive: '{submodule-recursive}'
821           choosing-strategy: default
822           jenkins-ssh-credential: '{jenkins-ssh-credential}'
823
824     triggers:
825       - lf-infra-github-pr-trigger:
826           trigger-phrase: '^recheck$'
827           only-trigger-phrase: false
828           status-context: 'Maven Verify'
829           permit-all: true
830           github-hooks: true
831           github-org: ''
832           github_pr_whitelist:
833             - ''
834           github_pr_admin_list:
835             - ''
836
837 ################
838 # Maven Verify #
839 ################
840
841 - lf_maven_verify: &lf_maven_verify
842     name: lf-maven-verify
843
844     ######################
845     # Default parameters #
846     ######################
847
848     branch: master
849     build-days-to-keep: 7
850     build-timeout: 60
851     git-url: '$GIT_URL/$PROJECT'
852     java-version: openjdk8
853     mvn-global-settings: global-settings
854     mvn-opts: ''
855     mvn-params: '-Dstream=$STREAM'
856     mvn-version: mvn33
857     staging-profile-id: ''  # Unused in this job
858     stream: master
859     submodule-recursive: true
860
861     gerrit_verify_triggers:
862       - patchset-created-event:
863           exclude-drafts: true
864           exclude-trivial-rebase: false
865           exclude-no-code-change: false
866       - draft-published-event
867       - comment-added-contains-event:
868           comment-contains-value: recheck$
869     gerrit_trigger_file_paths:
870       - compare-type: ANT
871         pattern: '**'
872
873     #####################
874     # Job Configuration #
875     #####################
876
877     concurrent: true
878
879     builders:
880       - lf-jacoco-nojava-workaround
881       - lf-maven-install:
882           mvn-version: '{mvn-version}'
883       - lf-provide-maven-settings:
884           global-settings-file: '{mvn-global-settings}'
885           settings-file: '{mvn-settings}'
886       - shell: !include-raw-escape:
887           - ../shell/lftools-install.sh
888           - ../shell/common-variables.sh
889           - ../shell/maven-build.sh
890       - lf-provide-maven-settings-cleanup
891
892     publishers:
893       - findbugs
894       - lf-jacoco-report
895       - lf-infra-publish
896
897 - job-template:
898     name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
899     id: gerrit-maven-verify
900     <<: *lf_maven_common
901     # yamllint disable-line rule:key-duplicates
902     <<: *lf_maven_verify
903
904     scm:
905       - lf-infra-gerrit-scm:
906           jenkins-ssh-credential: '{jenkins-ssh-credential}'
907           git-url: '{git-url}'
908           refspec: '$GERRIT_REFSPEC'
909           branch: '$GERRIT_BRANCH'
910           submodule-recursive: '{submodule-recursive}'
911           choosing-strategy: gerrit
912
913     triggers:
914       - gerrit:
915           server-name: '{gerrit-server-name}'
916           trigger-on: '{obj:gerrit_verify_triggers}'
917           projects:
918             - project-compare-type: ANT
919               project-pattern: '{project}'
920               branches:
921                 - branch-compare-type: ANT
922                   branch-pattern: '**/{branch}'
923               file-paths: '{obj:gerrit_trigger_file_paths}'
924
925 - job-template:
926     name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
927     id: github-maven-verify
928     <<: *lf_maven_common
929     # yamllint disable-line rule:key-duplicates
930     <<: *lf_maven_verify
931
932     properties:
933       - github:
934           url: '{git-url}/{github-org}/{project}'
935
936     scm:
937       - lf-infra-github-scm:
938           url: '{git-clone-url}{github-org}/{project}'
939           refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
940           branch: '$sha1'
941           submodule-recursive: '{submodule-recursive}'
942           choosing-strategy: default
943           jenkins-ssh-credential: '{jenkins-ssh-credential}'
944
945     triggers:
946       - lf-infra-github-pr-trigger:
947           trigger-phrase: '^recheck$'
948           only-trigger-phrase: false
949           status-context: 'Maven Verify'
950           permit-all: true
951           github-hooks: true
952           github-org: ''
953           github_pr_whitelist:
954             - ''
955           github_pr_admin_list:
956             - ''
957
958 #############################
959 # Maven Verify Dependencies #
960 #############################
961
962 - lf_maven_verify_dependencies: &lf_maven_verify_dependencies
963     name: lf-maven-verify-dependencies
964
965     ######################
966     # Default parameters #
967     ######################
968
969     branch: master
970     build-days-to-keep: 7
971     build-timeout: 60
972     git-url: '$GIT_URL/$PROJECT'
973     java-version: openjdk8
974     mvn-global-settings: global-settings
975     mvn-opts: ''
976     mvn-params: '-Dstream=$STREAM'
977     mvn-version: mvn33
978     staging-profile-id: ''  # Unused by this job
979     stream: master
980     submodule-recursive: true
981
982     gerrit_verify_triggers:
983       - comment-added-contains-event:
984           comment-contains-value: 'recheck: [0-9 ]+'
985     gerrit_trigger_file_paths:
986       - compare-type: ANT
987         pattern: '**'
988
989     #####################
990     # Job Configuration #
991     #####################
992
993     concurrent: true
994
995     builders:
996       - lf-jacoco-nojava-workaround
997       - lf-maven-install:
998           mvn-version: '{mvn-version}'
999       - lf-provide-maven-settings:
1000           global-settings-file: '{mvn-global-settings}'
1001           settings-file: '{mvn-settings}'
1002       - lf-fetch-dependent-patches
1003       - shell: !include-raw-escape:
1004           - ../shell/common-variables.sh
1005           - ../shell/maven-build-deps.sh
1006       - shell: !include-raw-escape:
1007           - ../shell/common-variables.sh
1008           - ../shell/maven-build.sh
1009       - lf-provide-maven-settings-cleanup
1010
1011     publishers:
1012       - findbugs
1013       - lf-jacoco-report
1014       - lf-infra-publish
1015
1016 - job-template:
1017     name: '{project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}'
1018     id: gerrit-maven-verify-dependencies
1019     <<: *lf_maven_common
1020     # yamllint disable-line rule:key-duplicates
1021     <<: *lf_maven_verify_dependencies
1022
1023     scm:
1024       - lf-infra-gerrit-scm:
1025           jenkins-ssh-credential: '{jenkins-ssh-credential}'
1026           git-url: '{git-url}'
1027           refspec: '$GERRIT_REFSPEC'
1028           branch: '$GERRIT_BRANCH'
1029           submodule-recursive: '{submodule-recursive}'
1030           choosing-strategy: gerrit
1031
1032     triggers:
1033       - gerrit:
1034           server-name: '{gerrit-server-name}'
1035           trigger-on: '{obj:gerrit_verify_triggers}'
1036           projects:
1037             - project-compare-type: ANT
1038               project-pattern: '{project}'
1039               branches:
1040                 - branch-compare-type: ANT
1041                   branch-pattern: '**/{branch}'
1042               file-paths: '{obj:gerrit_trigger_file_paths}'