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
10 # TODO: Add Maven Merge job to this list once it's been fully tested.
14 - gerrit-maven-release
16 - gerrit-maven-verify-dependencies
19 name: '{project-name}-github-maven-jobs'
21 # This job group contains all the recommended jobs that should be deployed
22 # for any project ci that is using github.
24 # TODO: Add Maven Merge job to this list once it's been fully tested.
28 - github-maven-release
32 name: '{project-name}-maven-javadoc-jobs'
34 # This job group contains all the recommended jobs that should be deployed
38 - gerrit-maven-javadoc-publish
39 - gerrit-maven-javadoc-verify
42 name: '{project-name}-github-maven-javadoc-jobs'
44 # This job group contains all the recommended jobs that should be deployed
48 - github-maven-javadoc-publish
49 - github-maven-javadoc-verify
55 - lf_maven_common: &lf_maven_common
58 ######################
59 # Default parameters #
60 ######################
65 **/target/**/feature.xml
66 **/target/failsafe-reports/failsafe-summary.xml
67 **/target/surefire-reports/*-output.txt
73 project-type: freestyle
78 - lf-infra-properties:
79 build-days-to-keep: '{build-days-to-keep}'
82 - lf-infra-parameters:
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}'
94 name: ARCHIVE_ARTIFACTS
95 default: '{archive-artifacts}'
96 description: Artifacts to archive to the logs server.
100 build-timeout: '{build-timeout}'
101 jenkins-ssh-credential: '{jenkins-ssh-credential}'
104 # TODO: Make email notification work.
105 # - lf-infra-email-notify:
106 # email-recipients: '{email-recipients}'
107 # email-prefix: '[releng]'
114 - lf_maven_clm: &lf_maven_clm
117 ######################
118 # Default parameters #
119 ######################
122 build-days-to-keep: 30 # 30 days for troubleshooting purposes
124 git-url: '$GIT_URL/$PROJECT'
125 java-version: openjdk8
126 mvn-global-settings: global-settings
130 staging-profile-id: '' # Unused in this job
132 submodule-recursive: true
135 - comment-added-contains-event:
136 comment-contains-value: run-clm$
138 #####################
139 # Job Configuration #
140 #####################
143 # Build weekly on Saturdays
146 server-name: '{gerrit-server-name}'
147 trigger-on: '{obj:gerrit_clm_triggers}'
149 - project-compare-type: ANT
150 project-pattern: '{project}'
152 - branch-compare-type: ANT
153 branch-pattern: '**/{branch}'
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'
172 application-name: '{project-name}'
175 name: '{project-name}-maven-clm-{stream}'
178 # yamllint disable-line rule:key-duplicates
182 - lf-infra-gerrit-scm:
183 jenkins-ssh-credential: '{jenkins-ssh-credential}'
185 refspec: '$GERRIT_REFSPEC'
186 branch: '$GERRIT_BRANCH'
187 submodule-recursive: '{submodule-recursive}'
188 choosing-strategy: default
191 name: '{project-name}-maven-clm-{stream}'
194 # yamllint disable-line rule:key-duplicates
199 url: '{git-url}/{github-org}/{project}'
202 - lf-infra-github-scm:
203 url: '{git-clone-url}{github-org}/{project}'
205 branch: 'refs/heads/{branch}'
206 submodule-recursive: '{submodule-recursive}'
207 choosing-strategy: default
208 jenkins-ssh-credential: '{jenkins-ssh-credential}'
211 - lf-infra-github-pr-trigger:
212 trigger-phrase: '^run-clm$'
213 only-trigger-phrase: false
214 status-context: 'CLM'
220 github_pr_admin_list:
223 #########################
224 # Maven Javadoc Publish #
225 #########################
227 - lf_maven_javadoc_publish: &lf_maven_javadoc_publish
228 name: lf-maven-javadoc-publish
230 ######################
231 # Default parameters #
232 ######################
235 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
237 git-url: '$GIT_URL/$PROJECT'
238 java-version: openjdk8
239 mvn-global-settings: global-settings
243 staging-profile-id: '' # Unused by the javadoc jobs
245 submodule-recursive: true
247 gerrit_merge_triggers:
248 - change-merged-event
249 - comment-added-contains-event:
250 comment-contains-value: remerge$
252 #####################
253 # Job Configuration #
254 #####################
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}'
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
274 name: '{project-name}-maven-javadoc-publish-{stream}'
275 id: gerrit-maven-javadoc-publish
277 # yamllint disable-line rule:key-duplicates
278 <<: *lf_maven_javadoc_publish
280 git-url: '$GIT_URL/$GERRIT_PROJECT'
283 - lf-infra-gerrit-scm:
287 submodule-recursive: '{submodule-recursive}'
288 choosing-strategy: default
289 jenkins-ssh-credential: '{jenkins-ssh-credential}'
293 server-name: '{gerrit-server-name}'
294 trigger-on: '{obj:gerrit_merge_triggers}'
296 - project-compare-type: ANT
297 project-pattern: '{project}'
299 - branch-compare-type: ANT
300 branch-pattern: '**/{branch}'
303 name: '{project-name}-maven-javadoc-publish-{stream}'
304 id: github-maven-javadoc-publish
306 # yamllint disable-line rule:key-duplicates
307 <<: *lf_maven_javadoc_publish
311 url: '{git-url}/{github-org}/{project}'
314 - lf-infra-github-scm:
315 url: '{git-clone-url}{github-org}/{project}'
318 submodule-recursive: '{submodule-recursive}'
319 choosing-strategy: default
320 jenkins-ssh-credential: '{jenkins-ssh-credential}'
326 - lf-infra-github-pr-trigger:
327 trigger-phrase: '^remerge$'
328 only-trigger-phrase: true
329 status-context: 'JJB Merge'
332 github-org: '{github-org}'
333 github_pr_whitelist: '{obj:github_pr_whitelist}'
334 github_pr_admin_list: '{obj:github_pr_admin_list}'
336 ########################
337 # Maven Javadoc Verify #
338 ########################
340 - lf_maven_javadoc_verify: &lf_maven_javadoc_verify
341 name: lf-maven-javadoc-verify
343 ######################
344 # Default parameters #
345 ######################
348 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
350 git-url: '$GIT_URL/$PROJECT'
351 java-version: openjdk8
352 mvn-global-settings: global-settings
356 staging-profile-id: '' # Unused by the javadoc jobs
358 submodule-recursive: true
360 gerrit_verify_triggers:
361 - patchset-created-event:
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$
369 #####################
370 # Job Configuration #
371 #####################
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
387 name: '{project-name}-maven-javadoc-verify-{stream}'
388 id: gerrit-maven-javadoc-verify
390 # yamllint disable-line rule:key-duplicates
391 <<: *lf_maven_javadoc_verify
394 - lf-infra-gerrit-scm:
395 jenkins-ssh-credential: '{jenkins-ssh-credential}'
397 refspec: '$GERRIT_REFSPEC'
398 branch: '$GERRIT_BRANCH'
399 submodule-recursive: '{submodule-recursive}'
400 choosing-strategy: gerrit
404 server-name: '{gerrit-server-name}'
405 trigger-on: '{obj:gerrit_verify_triggers}'
407 - project-compare-type: ANT
408 project-pattern: '{project}'
410 - branch-compare-type: ANT
411 branch-pattern: '**/{branch}'
414 name: '{project-name}-maven-javadoc-verify-{stream}'
415 id: github-maven-javadoc-verify
417 # yamllint disable-line rule:key-duplicates
418 <<: *lf_maven_javadoc_verify
422 url: '{git-url}/{github-org}/{project}'
425 - lf-infra-github-scm:
426 url: '{git-clone-url}{github-org}/{project}'
427 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
429 submodule-recursive: '{submodule-recursive}'
430 choosing-strategy: default
431 jenkins-ssh-credential: '{jenkins-ssh-credential}'
434 - lf-infra-github-pr-trigger:
435 trigger-phrase: '^recheck$'
436 only-trigger-phrase: true
437 status-context: 'Maven Javadoc'
443 github_pr_admin_list:
450 - lf_maven_merge: &lf_maven_merge
453 ######################
454 # Default parameters #
455 ######################
458 build-days-to-keep: 30 # 30 days in case we need to troubleshoot
461 git-url: '$GIT_URL/$PROJECT'
462 java-version: openjdk8
463 mvn-global-settings: global-settings
465 mvn-params: '-Dmerge'
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.
470 submodule-recursive: true
472 gerrit_merge_triggers:
473 - change-merged-event
474 - comment-added-contains-event:
475 comment-contains-value: remerge$
477 gerrit_trigger_file_paths:
481 post_build_trigger: ''
483 #####################
484 # Job Configuration #
485 #####################
488 - lf-jacoco-nojava-workaround
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}'
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
512 - trigger-parameterized-builds: '{obj:post_build_trigger}'
515 name: '{project-name}-maven-merge-{stream}'
516 id: gerrit-maven-merge
518 # yamllint disable-line rule:key-duplicates
522 - lf-infra-gerrit-scm:
523 jenkins-ssh-credential: '{jenkins-ssh-credential}'
525 refspec: '$GERRIT_REFSPEC'
526 branch: '$GERRIT_BRANCH'
527 submodule-recursive: '{submodule-recursive}'
528 choosing-strategy: default
533 server-name: '{gerrit-server-name}'
534 trigger-on: '{obj:gerrit_merge_triggers}'
536 - project-compare-type: ANT
537 project-pattern: '{project}'
539 - branch-compare-type: ANT
540 branch-pattern: '**/{branch}'
541 file-paths: '{obj:gerrit_trigger_file_paths}'
544 name: '{project-name}-maven-merge-{stream}'
545 id: github-maven-merge
547 # yamllint disable-line rule:key-duplicates
552 url: '{git-url}/{github-org}/{project}'
555 - lf-infra-github-scm:
556 url: '{git-clone-url}{github-org}/{project}'
557 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
559 submodule-recursive: '{submodule-recursive}'
560 choosing-strategy: default
561 jenkins-ssh-credential: '{jenkins-ssh-credential}'
564 - lf-infra-github-pr-trigger:
565 trigger-phrase: '^remerge$'
566 only-trigger-phrase: false
567 status-context: 'Maven Merge'
573 github_pr_admin_list:
580 - lf_maven_release: &lf_maven_release
581 name: lf-maven-release
583 ######################
584 # Default parameters #
585 ######################
588 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
591 git-url: '$GIT_URL/$PROJECT'
592 java-version: openjdk8
593 mvn-global-settings: global-settings
598 submodule-recursive: true
600 gerrit_release_triggers:
601 - comment-added-contains-event:
602 comment-contains-value: build release$
604 #####################
605 # Job Configuration #
606 #####################
609 - lf-jacoco-nojava-workaround
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
626 name: '{project-name}-maven-release-{stream}'
627 id: gerrit-maven-release
629 # yamllint disable-line rule:key-duplicates
630 <<: *lf_maven_release
633 - lf-infra-gerrit-scm:
634 jenkins-ssh-credential: '{jenkins-ssh-credential}'
636 refspec: '$GERRIT_REFSPEC'
637 branch: '$GERRIT_BRANCH'
638 submodule-recursive: '{submodule-recursive}'
639 choosing-strategy: default
642 - timed: '{obj:cron}'
644 server-name: '{gerrit-server-name}'
645 trigger-on: '{obj:gerrit_release_triggers}'
647 - project-compare-type: ANT
648 project-pattern: '{project}'
650 - branch-compare-type: ANT
651 branch-pattern: '**/{branch}'
654 name: '{project-name}-maven-release-{stream}'
655 id: github-maven-release
657 # yamllint disable-line rule:key-duplicates
658 <<: *lf_maven_release
662 url: '{git-url}/{github-org}/{project}'
665 - lf-infra-github-scm:
666 url: '{git-clone-url}{github-org}/{project}'
667 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
669 submodule-recursive: '{submodule-recursive}'
670 choosing-strategy: default
671 jenkins-ssh-credential: '{jenkins-ssh-credential}'
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'
684 github_pr_admin_list:
691 - lf_maven_sonar: &lf_maven_sonar
694 ######################
695 # Default parameters #
696 ######################
698 branch: master # Sonar should always be run on master branch
699 build-days-to-keep: 7
701 git-url: '$GIT_URL/$PROJECT'
702 java-version: openjdk8
703 mvn-global-settings: global-settings
707 sonar-mvn-goal: 'sonar:sonar'
708 staging-profile-id: '' # Unused in this job
710 submodule-recursive: true
712 gerrit_sonar_triggers:
713 - comment-added-contains-event:
714 comment-contains-value: run-sonar$
716 #####################
717 # Job Configuration #
718 #####################
721 - lf-infra-parameters:
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: ''
733 name: ARCHIVE_ARTIFACTS
734 default: '{archive-artifacts}'
735 description: Artifacts to archive to the logs server.
737 name: SONAR_MAVEN_GOAL
738 default: '{sonar-mvn-goal}'
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".
747 server-name: '{gerrit-server-name}'
748 trigger-on: '{obj:gerrit_sonar_triggers}'
750 - project-compare-type: 'ANT'
751 project-pattern: '{project}'
753 - branch-compare-type: 'ANT'
754 branch-pattern: '**/master'
762 - lf-infra-maven-sonar:
763 mvn-settings: '{mvn-settings}'
764 mvn-version: '{mvn-version}'
772 name: lf-infra-maven-sonar
773 # Run a Sonar build with Maven
776 mvn-version: '{mvn-version}'
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
789 name: '{project-name}-sonar'
790 id: gerrit-maven-sonar
792 # yamllint disable-line rule:key-duplicates
796 - lf-infra-gerrit-scm:
797 jenkins-ssh-credential: '{jenkins-ssh-credential}'
799 refspec: $GERRIT_REFSPEC
800 branch: $GERRIT_BRANCH
801 submodule-recursive: '{submodule-recursive}'
802 choosing-strategy: default
805 name: '{project-name}-sonar'
806 id: github-maven-sonar
808 # yamllint disable-line rule:key-duplicates
813 url: '{git-url}/{github-org}/{project}'
816 - lf-infra-github-scm:
817 url: '{git-clone-url}{github-org}/{project}'
818 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
820 submodule-recursive: '{submodule-recursive}'
821 choosing-strategy: default
822 jenkins-ssh-credential: '{jenkins-ssh-credential}'
825 - lf-infra-github-pr-trigger:
826 trigger-phrase: '^recheck$'
827 only-trigger-phrase: false
828 status-context: 'Maven Verify'
834 github_pr_admin_list:
841 - lf_maven_verify: &lf_maven_verify
842 name: lf-maven-verify
844 ######################
845 # Default parameters #
846 ######################
849 build-days-to-keep: 7
851 git-url: '$GIT_URL/$PROJECT'
852 java-version: openjdk8
853 mvn-global-settings: global-settings
855 mvn-params: '-Dstream=$STREAM'
857 staging-profile-id: '' # Unused in this job
859 submodule-recursive: true
861 gerrit_verify_triggers:
862 - patchset-created-event:
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:
873 #####################
874 # Job Configuration #
875 #####################
880 - lf-jacoco-nojava-workaround
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
898 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
899 id: gerrit-maven-verify
901 # yamllint disable-line rule:key-duplicates
905 - lf-infra-gerrit-scm:
906 jenkins-ssh-credential: '{jenkins-ssh-credential}'
908 refspec: '$GERRIT_REFSPEC'
909 branch: '$GERRIT_BRANCH'
910 submodule-recursive: '{submodule-recursive}'
911 choosing-strategy: gerrit
915 server-name: '{gerrit-server-name}'
916 trigger-on: '{obj:gerrit_verify_triggers}'
918 - project-compare-type: ANT
919 project-pattern: '{project}'
921 - branch-compare-type: ANT
922 branch-pattern: '**/{branch}'
923 file-paths: '{obj:gerrit_trigger_file_paths}'
926 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
927 id: github-maven-verify
929 # yamllint disable-line rule:key-duplicates
934 url: '{git-url}/{github-org}/{project}'
937 - lf-infra-github-scm:
938 url: '{git-clone-url}{github-org}/{project}'
939 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
941 submodule-recursive: '{submodule-recursive}'
942 choosing-strategy: default
943 jenkins-ssh-credential: '{jenkins-ssh-credential}'
946 - lf-infra-github-pr-trigger:
947 trigger-phrase: '^recheck$'
948 only-trigger-phrase: false
949 status-context: 'Maven Verify'
955 github_pr_admin_list:
958 #############################
959 # Maven Verify Dependencies #
960 #############################
962 - lf_maven_verify_dependencies: &lf_maven_verify_dependencies
963 name: lf-maven-verify-dependencies
965 ######################
966 # Default parameters #
967 ######################
970 build-days-to-keep: 7
972 git-url: '$GIT_URL/$PROJECT'
973 java-version: openjdk8
974 mvn-global-settings: global-settings
976 mvn-params: '-Dstream=$STREAM'
978 staging-profile-id: '' # Unused by this job
980 submodule-recursive: true
982 gerrit_verify_triggers:
983 - comment-added-contains-event:
984 comment-contains-value: 'recheck: [0-9 ]+'
985 gerrit_trigger_file_paths:
989 #####################
990 # Job Configuration #
991 #####################
996 - lf-jacoco-nojava-workaround
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
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
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
1034 server-name: '{gerrit-server-name}'
1035 trigger-on: '{obj:gerrit_verify_triggers}'
1037 - project-compare-type: ANT
1038 project-pattern: '{project}'
1040 - branch-compare-type: ANT
1041 branch-pattern: '**/{branch}'
1042 file-paths: '{obj:gerrit_trigger_file_paths}'