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