2 # This file contains job templates for Maven projects.
5 name: '{project-name}-maven-jobs'
7 # This job group contains all the recommended jobs that should be deployed
12 - gerrit-maven-release
14 - gerrit-maven-verify-dependencies
17 name: '{project-name}-github-maven-jobs'
19 # This job group contains all the recommended jobs that should be deployed
20 # for any project ci that is using github.
24 - github-maven-release
28 name: '{project-name}-maven-javadoc-jobs'
30 # This job group contains all the recommended jobs that should be deployed
34 - gerrit-maven-javadoc-publish
35 - gerrit-maven-javadoc-verify
38 name: '{project-name}-github-maven-javadoc-jobs'
40 # This job group contains all the recommended jobs that should be deployed
44 - github-maven-javadoc-publish
45 - github-maven-javadoc-verify
51 - lf_maven_common: &lf_maven_common
54 project-type: freestyle
59 - lf-infra-properties:
60 build-days-to-keep: '{build-days-to-keep}'
63 - lf-infra-parameters:
67 lftools-version: '{lftools-version}'
68 - lf-infra-maven-parameters:
69 mvn-opts: '{mvn-opts}'
70 mvn-params: '{mvn-params}'
71 mvn-version: '{mvn-version}'
72 # Staging repos do not make sense for CLM jobs so set it blank.
73 staging-profile-id: '{staging-profile-id}'
75 name: ARCHIVE_ARTIFACTS
76 default: '{archive-artifacts}'
77 description: Artifacts to archive to the logs server.
81 build-timeout: '{build-timeout}'
82 jenkins-ssh-credential: '{jenkins-ssh-credential}'
85 # TODO: Make email notification work.
86 # - lf-infra-email-notify:
87 # email-recipients: '{email-recipients}'
88 # email-prefix: '[releng]'
95 - lf_maven_clm: &lf_maven_clm
98 ######################
99 # Default parameters #
100 ######################
102 archive-artifacts: ''
104 build-days-to-keep: 30 # 30 days for troubleshooting purposes
106 git-url: '$GIT_URL/$PROJECT'
107 java-version: openjdk8
108 mvn-global-settings: global-settings
112 staging-profile-id: '' # Unused in this job
114 submodule-recursive: true
116 #####################
117 # Job Configuration #
118 #####################
121 # Build weekly on Saturdays
126 mvn-version: '{mvn-version}'
127 - lf-provide-maven-settings:
128 global-settings-file: '{mvn-global-settings}'
129 settings-file: '{mvn-settings}'
130 - shell: !include-raw-escape:
131 - ../shell/common-variables.sh
132 - ../shell/sonatype-clm.sh
133 - lf-provide-maven-settings-cleanup
134 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
136 application-name: '{project-name}'
139 name: '{project-name}-maven-clm-{stream}'
142 # yamllint disable-line rule:key-duplicates
146 - lf-infra-gerrit-scm:
147 jenkins-ssh-credential: '{jenkins-ssh-credential}'
149 refspec: '$GERRIT_REFSPEC'
150 branch: '$GERRIT_BRANCH'
151 submodule-recursive: '{submodule-recursive}'
152 choosing-strategy: default
155 name: '{project-name}-maven-clm-{stream}'
158 # yamllint disable-line rule:key-duplicates
163 url: '{git-url}/{github-org}/{project}'
166 - lf-infra-github-scm:
167 url: '{git-clone-url}{github-org}/{project}'
168 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
170 submodule-recursive: '{submodule-recursive}'
171 choosing-strategy: default
172 jenkins-ssh-credential: '{jenkins-ssh-credential}'
174 #########################
175 # Maven Javadoc Publish #
176 #########################
178 - lf_maven_javadoc_publish: &lf_maven_javadoc_publish
179 name: lf-maven-javadoc-publish
181 ######################
182 # Default parameters #
183 ######################
185 archive-artifacts: ''
187 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
189 git-url: '$GIT_URL/$PROJECT'
190 java-version: openjdk8
191 mvn-global-settings: global-settings
195 staging-profile-id: '' # Unused by the javadoc jobs
197 submodule-recursive: true
199 gerrit_merge_triggers:
200 - change-merged-event
201 - comment-added-contains-event:
202 comment-contains-value: remerge$
204 #####################
205 # Job Configuration #
206 #####################
210 mvn-version: '{mvn-version}'
211 - lf-provide-maven-settings:
212 global-settings-file: '{mvn-global-settings}'
213 settings-file: '{mvn-settings}'
214 - lf-infra-create-netrc:
215 server-id: '{mvn-site-id}'
217 properties-content: 'DEPLOY_PATH={javadoc-path}'
218 - shell: !include-raw-escape:
219 - ../shell/common-variables.sh
220 - ../shell/maven-javadoc-generate.sh
221 - ../shell/lftools-install.sh
222 - ../shell/maven-javadoc-publish.sh
223 - lf-provide-maven-settings-cleanup
226 name: '{project-name}-maven-javadoc-publish-{stream}'
227 id: gerrit-maven-javadoc-publish
229 # yamllint disable-line rule:key-duplicates
230 <<: *lf_maven_javadoc_publish
232 git-url: '$GIT_URL/$GERRIT_PROJECT'
235 - lf-infra-gerrit-scm:
239 submodule-recursive: '{submodule-recursive}'
240 choosing-strategy: default
241 jenkins-ssh-credential: '{jenkins-ssh-credential}'
245 server-name: '{gerrit-server-name}'
246 trigger-on: '{obj:gerrit_merge_triggers}'
248 - project-compare-type: ANT
249 project-pattern: '{project}'
251 - branch-compare-type: ANT
252 branch-pattern: '**/{branch}'
255 name: '{project-name}-maven-javadoc-publish-{stream}'
256 id: github-maven-javadoc-publish
258 # yamllint disable-line rule:key-duplicates
259 <<: *lf_maven_javadoc_publish
263 url: '{git-url}/{github-org}/{project}'
266 - lf-infra-github-scm:
267 url: '{git-clone-url}{github-org}/{project}'
270 submodule-recursive: '{submodule-recursive}'
271 choosing-strategy: default
272 jenkins-ssh-credential: '{jenkins-ssh-credential}'
278 - lf-infra-github-pr-trigger:
279 trigger-phrase: '^remerge$'
280 only-trigger-phrase: true
281 status-context: 'JJB Merge'
284 github-org: '{github-org}'
285 github_pr_whitelist: '{obj:github_pr_whitelist}'
286 github_pr_admin_list: '{obj:github_pr_admin_list}'
288 ########################
289 # Maven Javadoc Verify #
290 ########################
292 - lf_maven_javadoc_verify: &lf_maven_javadoc_verify
293 name: lf-maven-javadoc-verify
295 ######################
296 # Default parameters #
297 ######################
299 archive-artifacts: ''
301 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
303 git-url: '$GIT_URL/$PROJECT'
304 java-version: openjdk8
305 mvn-global-settings: global-settings
309 staging-profile-id: '' # Unused by the javadoc jobs
311 submodule-recursive: true
313 gerrit_verify_triggers:
314 - patchset-created-event:
316 exclude-trivial-rebase: false
317 exclude-no-code-change: false
318 - draft-published-event
319 - comment-added-contains-event:
320 comment-contains-value: recheck$
322 #####################
323 # Job Configuration #
324 #####################
330 mvn-version: '{mvn-version}'
331 - lf-provide-maven-settings:
332 global-settings-file: '{mvn-global-settings}'
333 settings-file: '{mvn-settings}'
334 - shell: !include-raw-escape:
335 - ../shell/common-variables.sh
336 - ../shell/maven-javadoc-generate.sh
337 - lf-provide-maven-settings-cleanup
340 name: '{project-name}-maven-javadoc-verify-{stream}'
341 id: gerrit-maven-javadoc-verify
343 # yamllint disable-line rule:key-duplicates
344 <<: *lf_maven_javadoc_verify
347 - lf-infra-gerrit-scm:
348 jenkins-ssh-credential: '{jenkins-ssh-credential}'
350 refspec: '$GERRIT_REFSPEC'
351 branch: '$GERRIT_BRANCH'
352 submodule-recursive: '{submodule-recursive}'
353 choosing-strategy: gerrit
357 server-name: '{gerrit-server-name}'
358 trigger-on: '{obj:gerrit_verify_triggers}'
360 - project-compare-type: ANT
361 project-pattern: '{project}'
363 - branch-compare-type: ANT
364 branch-pattern: '**/{branch}'
367 name: '{project-name}-maven-javadoc-verify-{stream}'
368 id: github-maven-javadoc-verify
370 # yamllint disable-line rule:key-duplicates
371 <<: *lf_maven_javadoc_verify
375 url: '{git-url}/{github-org}/{project}'
378 - lf-infra-github-scm:
379 url: '{git-clone-url}{github-org}/{project}'
380 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
382 submodule-recursive: '{submodule-recursive}'
383 choosing-strategy: default
384 jenkins-ssh-credential: '{jenkins-ssh-credential}'
387 - lf-infra-github-pr-trigger:
388 trigger-phrase: '^recheck$'
389 only-trigger-phrase: true
390 status-context: 'Maven Javadoc'
396 github_pr_admin_list:
403 - lf_maven_release: &lf_maven_release
404 name: lf-maven-release
406 ######################
407 # Default parameters #
408 ######################
410 archive-artifacts: ''
412 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
415 git-url: '$GIT_URL/$PROJECT'
416 java-version: openjdk8
417 mvn-global-settings: global-settings
422 submodule-recursive: true
424 gerrit_release_triggers:
425 - comment-added-contains-event:
426 comment-contains-value: build release$
428 #####################
429 # Job Configuration #
430 #####################
433 - lf-jacoco-nojava-workaround
435 mvn-version: '{mvn-version}'
436 - lf-provide-maven-settings:
437 global-settings-file: '{mvn-global-settings}'
438 settings-file: '{mvn-settings}'
439 - lf-infra-create-netrc:
440 server-id: '{mvn-staging-id}'
441 - shell: !include-raw-escape:
442 - ../shell/lftools-install.sh
443 - ../shell/common-variables.sh
444 - ../shell/maven-patch-release.sh
445 - ../shell/maven-build.sh
446 - ../shell/maven-stage.sh
447 - lf-provide-maven-settings-cleanup
450 name: '{project-name}-maven-release-{stream}'
451 id: gerrit-maven-release
453 # yamllint disable-line rule:key-duplicates
454 <<: *lf_maven_release
457 - lf-infra-gerrit-scm:
458 jenkins-ssh-credential: '{jenkins-ssh-credential}'
460 refspec: '$GERRIT_REFSPEC'
461 branch: '$GERRIT_BRANCH'
462 submodule-recursive: '{submodule-recursive}'
463 choosing-strategy: default
466 - timed: '{obj:cron}'
468 server-name: '{gerrit-server-name}'
469 trigger-on: '{obj:gerrit_release_triggers}'
471 - project-compare-type: ANT
472 project-pattern: '{project}'
474 - branch-compare-type: ANT
475 branch-pattern: '**/{branch}'
478 name: '{project-name}-maven-release-{stream}'
479 id: github-maven-release
481 # yamllint disable-line rule:key-duplicates
482 <<: *lf_maven_release
486 url: '{git-url}/{github-org}/{project}'
489 - lf-infra-github-scm:
490 url: '{git-clone-url}{github-org}/{project}'
491 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
493 submodule-recursive: '{submodule-recursive}'
494 choosing-strategy: default
495 jenkins-ssh-credential: '{jenkins-ssh-credential}'
498 - timed: '{obj:cron}'
499 - lf-infra-github-pr-trigger:
500 trigger-phrase: '^build release$'
501 only-trigger-phrase: true
502 status-context: 'Maven Release'
508 github_pr_admin_list:
515 - lf_maven_sonar: &lf_maven_sonar
518 ######################
519 # Default parameters #
520 ######################
522 archive-artifacts: ''
523 branch: master # Sonar should always be run on master branch
524 build-days-to-keep: 7
526 git-url: '$GIT_URL/$PROJECT'
527 java-version: openjdk8
528 mvn-global-settings: global-settings
532 staging-profile-id: '' # Unused in this job
534 submodule-recursive: true
536 gerrit_sonar_triggers:
537 - comment-added-contains-event:
538 comment-contains-value: run-sonar$
540 #####################
541 # Job Configuration #
542 #####################
547 server-name: '{gerrit-server-name}'
548 trigger-on: '{obj:gerrit_sonar_triggers}'
550 - project-compare-type: 'ANT'
551 project-pattern: '{project}'
553 - branch-compare-type: 'ANT'
554 branch-pattern: '**/master'
562 - lf-infra-maven-sonar:
563 mvn-settings: '{mvn-settings}'
564 mvn-version: '{mvn-version}'
572 name: lf-infra-maven-sonar
573 # Run a Sonar build with Maven
576 mvn-version: '{mvn-version}'
578 # Switch this to the sonar wrapper when JJB 2.0 is available
579 properties-content: |
580 SONAR_HOST_URL=$SONAR_URL
581 SONAR_MAVEN_GOAL=sonar:sonar
582 - lf-provide-maven-settings:
583 global-settings-file: global-settings
584 settings-file: '{mvn-settings}'
585 - shell: !include-raw-escape:
586 - ../shell/common-variables.sh
587 - ../shell/maven-sonar.sh
588 - lf-provide-maven-settings-cleanup
591 name: '{project-name}-sonar'
592 id: gerrit-maven-sonar
594 # yamllint disable-line rule:key-duplicates
598 - lf-infra-gerrit-scm:
599 jenkins-ssh-credential: '{jenkins-ssh-credential}'
601 refspec: $GERRIT_REFSPEC
602 branch: $GERRIT_BRANCH
603 submodule-recursive: '{submodule-recursive}'
604 choosing-strategy: default
607 name: '{project-name}-sonar'
608 id: github-maven-sonar
610 # yamllint disable-line rule:key-duplicates
615 url: '{git-url}/{github-org}/{project}'
618 - lf-infra-github-scm:
619 url: '{git-clone-url}{github-org}/{project}'
620 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
622 submodule-recursive: '{submodule-recursive}'
623 choosing-strategy: default
624 jenkins-ssh-credential: '{jenkins-ssh-credential}'
627 - lf-infra-github-pr-trigger:
628 trigger-phrase: '^recheck$'
629 only-trigger-phrase: false
630 status-context: 'Maven Verify'
636 github_pr_admin_list:
643 - lf_maven_verify: &lf_maven_verify
644 name: lf-maven-verify
646 ######################
647 # Default parameters #
648 ######################
650 archive-artifacts: ''
652 build-days-to-keep: 7
654 git-url: '$GIT_URL/$PROJECT'
655 java-version: openjdk8
656 mvn-global-settings: global-settings
658 mvn-params: '-Dstream=$STREAM'
660 staging-profile-id: '' # Unused in this job
662 submodule-recursive: true
664 gerrit_verify_triggers:
665 - patchset-created-event:
667 exclude-trivial-rebase: false
668 exclude-no-code-change: false
669 - draft-published-event
670 - comment-added-contains-event:
671 comment-contains-value: recheck$
672 gerrit_trigger_file_paths:
676 #####################
677 # Job Configuration #
678 #####################
683 - lf-jacoco-nojava-workaround
685 mvn-version: '{mvn-version}'
686 - lf-provide-maven-settings:
687 global-settings-file: '{mvn-global-settings}'
688 settings-file: '{mvn-settings}'
689 - shell: !include-raw-escape:
690 - ../shell/lftools-install.sh
691 - ../shell/common-variables.sh
692 - ../shell/maven-build.sh
693 - lf-provide-maven-settings-cleanup
701 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
702 id: gerrit-maven-verify
704 # yamllint disable-line rule:key-duplicates
708 - lf-infra-gerrit-scm:
709 jenkins-ssh-credential: '{jenkins-ssh-credential}'
711 refspec: '$GERRIT_REFSPEC'
712 branch: '$GERRIT_BRANCH'
713 submodule-recursive: '{submodule-recursive}'
714 choosing-strategy: gerrit
718 server-name: '{gerrit-server-name}'
719 trigger-on: '{obj:gerrit_verify_triggers}'
721 - project-compare-type: ANT
722 project-pattern: '{project}'
724 - branch-compare-type: ANT
725 branch-pattern: '**/{branch}'
726 file-paths: '{obj:gerrit_trigger_file_paths}'
729 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
730 id: github-maven-verify
732 # yamllint disable-line rule:key-duplicates
737 url: '{git-url}/{github-org}/{project}'
740 - lf-infra-github-scm:
741 url: '{git-clone-url}{github-org}/{project}'
742 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
744 submodule-recursive: '{submodule-recursive}'
745 choosing-strategy: default
746 jenkins-ssh-credential: '{jenkins-ssh-credential}'
749 - lf-infra-github-pr-trigger:
750 trigger-phrase: '^recheck$'
751 only-trigger-phrase: false
752 status-context: 'Maven Verify'
758 github_pr_admin_list:
761 #############################
762 # Maven Verify Dependencies #
763 #############################
765 - lf_maven_verify_dependencies: &lf_maven_verify_dependencies
766 name: lf-maven-verify-dependencies
768 ######################
769 # Default parameters #
770 ######################
772 archive-artifacts: ''
774 build-days-to-keep: 7
776 git-url: '$GIT_URL/$PROJECT'
777 java-version: openjdk8
778 mvn-global-settings: global-settings
780 mvn-params: '-Dstream=$STREAM'
782 staging-profile-id: '' # Unused by this job
784 submodule-recursive: true
786 gerrit_verify_triggers:
787 - comment-added-contains-event:
788 comment-contains-value: 'recheck: [0-9 ]+'
789 gerrit_trigger_file_paths:
793 #####################
794 # Job Configuration #
795 #####################
800 - lf-jacoco-nojava-workaround
802 mvn-version: '{mvn-version}'
803 - lf-provide-maven-settings:
804 global-settings-file: '{mvn-global-settings}'
805 settings-file: '{mvn-settings}'
806 - lf-fetch-dependent-patches
807 - shell: !include-raw-escape:
808 - ../shell/common-variables.sh
809 - ../shell/maven-build-deps.sh
810 - shell: !include-raw-escape:
811 - ../shell/common-variables.sh
812 - ../shell/maven-build.sh
813 - lf-provide-maven-settings-cleanup
821 name: '{project-name}-maven-verify-deps-{stream}-{mvn-version}-{java-version}'
822 id: gerrit-maven-verify-dependencies
824 # yamllint disable-line rule:key-duplicates
825 <<: *lf_maven_verify_dependencies
828 - lf-infra-gerrit-scm:
829 jenkins-ssh-credential: '{jenkins-ssh-credential}'
831 refspec: '$GERRIT_REFSPEC'
832 branch: '$GERRIT_BRANCH'
833 submodule-recursive: '{submodule-recursive}'
834 choosing-strategy: gerrit
838 server-name: '{gerrit-server-name}'
839 trigger-on: '{obj:gerrit_verify_triggers}'
841 - project-compare-type: ANT
842 project-pattern: '{project}'
844 - branch-compare-type: ANT
845 branch-pattern: '**/{branch}'
846 file-paths: '{obj:gerrit_trigger_file_paths}'