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
16 name: '{project-name}-github-maven-jobs'
18 # This job group contains all the recommended jobs that should be deployed
19 # for any project ci that is using github.
23 - github-maven-release
27 name: '{project-name}-maven-javadoc-jobs'
29 # This job group contains all the recommended jobs that should be deployed
33 - gerrit-maven-javadoc-publish
34 - gerrit-maven-javadoc-verify
37 name: '{project-name}-github-maven-javadoc-jobs'
39 # This job group contains all the recommended jobs that should be deployed
43 - github-maven-javadoc-publish
44 - github-maven-javadoc-verify
50 - lf_maven_common: &lf_maven_common
53 project-type: freestyle
58 - lf-infra-properties:
59 build-days-to-keep: '{build-days-to-keep}'
62 - lf-infra-parameters:
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}'
76 build-timeout: '{build-timeout}'
77 jenkins-ssh-credential: '{jenkins-ssh-credential}'
80 # TODO: Make email notification work.
81 # - lf-infra-email-notify:
82 # email-recipients: '{email-recipients}'
83 # email-prefix: '[releng]'
90 - lf_maven_clm: &lf_maven_clm
93 # Produces a CLM scan of the code into Nexus IQ Server.
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
102 # Optional parameters:
103 # mvn-global-settings: The name of the Maven global settings to use for
104 # Maven configuration. (default: global-settings)
106 ######################
107 # Default parameters #
108 ######################
111 build-days-to-keep: 30 # 30 days for troubleshooting purposes
113 git-url: '$GIT_URL/$PROJECT'
114 java-version: openjdk8
115 mvn-global-settings: global-settings
120 submodule-recursive: true
122 # Staging repos do not make sense for CLM jobs so set it blank.
123 staging-profile-id: ''
125 #####################
126 # Job Configuration #
127 #####################
130 # Build weekly on Saturdays
135 mvn-version: '{mvn-version}'
136 - lf-provide-maven-settings:
137 global-settings-file: '{mvn-global-settings}'
138 settings-file: '{mvn-settings}'
139 - shell: !include-raw-escape:
140 - ../shell/common-variables.sh
141 - ../shell/sonatype-clm.sh
142 - lf-provide-maven-settings-cleanup
143 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
145 application-name: '{project-name}'
148 name: '{project-name}-maven-clm-{stream}'
151 # yamllint disable-line rule:key-duplicates
155 - lf-infra-gerrit-scm:
156 jenkins-ssh-credential: '{jenkins-ssh-credential}'
158 refspec: '$GERRIT_REFSPEC'
159 branch: '$GERRIT_BRANCH'
160 submodule-recursive: '{submodule-recursive}'
161 choosing-strategy: default
164 name: '{project-name}-maven-clm-{stream}'
167 # yamllint disable-line rule:key-duplicates
172 url: '{git-url}/{github-org}/{project}'
175 - lf-infra-github-scm:
176 url: '{git-clone-url}{github-org}/{project}'
177 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
179 submodule-recursive: '{submodule-recursive}'
180 choosing-strategy: default
181 jenkins-ssh-credential: '{jenkins-ssh-credential}'
183 #########################
184 # Maven Javadoc Publish #
185 #########################
187 - lf_maven_javadoc_publish: &lf_maven_javadoc_publish
188 name: lf-maven-javadoc-publish
190 # Produces and publishes javadocs for a Maven project.
192 # Expects javadocs to be available in $WORKSPACE/target/site/apidocs
194 # Required parameters:
196 # :build-node: The node to run build on.
197 # :javadoc-path: The path in Nexus to deploy javadoc to.
198 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
199 # be configured in defaults.yaml)
200 # :mvn-settings: The name of settings file containing credentials for
202 # :mvn-site-id: Maven Server ID from settings.xml to pull credentials from.
203 # (Note: This setting should be configured in defaults.yaml.)
205 # Optional parameters:
207 # :branch: The branch to build against. (default: master)
208 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
209 # :build-timeout: Timeout in seconds before aborting build. (default: 60)
210 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
211 # :java-version: Version of Java to use for the build. (default: openjdk8)
212 # :mvn-global-settings: The name of the Maven global settings to use for
213 # Maven configuration. (default: global-settings)
214 # :mvn-opts: Sets MAVEN_OPTS. (default: '')
215 # :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
216 # :mvn-version: Version of maven to use. (default: mvn33)
217 # :submodule-recursive: Whether to checkout submodules recursively.
220 # :gerrit_javadoc_merge_triggers: Override Gerrit Triggers.
222 ######################
223 # Default parameters #
224 ######################
227 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
229 git-url: '$GIT_URL/$PROJECT'
230 java-version: openjdk8
231 mvn-global-settings: global-settings
236 submodule-recursive: true
238 gerrit_javadoc_merge_triggers:
239 - change-merged-event
240 - comment-added-contains-event:
241 comment-contains-value: remerge$
243 #####################
244 # Job Configuration #
245 #####################
249 mvn-version: '{mvn-version}'
250 - lf-provide-maven-settings:
251 global-settings-file: '{mvn-global-settings}'
252 settings-file: '{mvn-settings}'
253 - lf-infra-create-netrc:
254 server-id: '{mvn-site-id}'
256 properties-content: 'DEPLOY_PATH={javadoc-path}'
257 - shell: !include-raw-escape:
258 - ../shell/common-variables.sh
259 - ../shell/maven-javadoc-generate.sh
260 - ../shell/lftools-install.sh
261 - ../shell/maven-javadoc-publish.sh
262 - lf-provide-maven-settings-cleanup
265 name: '{project-name}-maven-javadoc-publish-{stream}'
266 id: gerrit-maven-javadoc-publish
268 # yamllint disable-line rule:key-duplicates
269 <<: *lf_maven_javadoc_publish
271 git-url: '$GIT_URL/$GERRIT_PROJECT'
274 - lf-infra-gerrit-scm:
278 submodule-recursive: '{submodule-recursive}'
279 choosing-strategy: default
280 jenkins-ssh-credential: '{jenkins-ssh-credential}'
284 server-name: '{gerrit-server-name}'
285 trigger-on: '{obj:gerrit_javadoc_merge_triggers}'
287 - project-compare-type: ANT
288 project-pattern: '{project}'
290 - branch-compare-type: ANT
291 branch-pattern: '**/{branch}'
294 name: '{project-name}-maven-javadoc-publish-{stream}'
295 id: github-maven-javadoc-publish
297 # yamllint disable-line rule:key-duplicates
298 <<: *lf_maven_javadoc_publish
302 url: '{git-url}/{github-org}/{project}'
305 - lf-infra-github-scm:
306 url: '{git-clone-url}{github-org}/{project}'
309 submodule-recursive: '{submodule-recursive}'
310 choosing-strategy: default
311 jenkins-ssh-credential: '{jenkins-ssh-credential}'
317 - lf-infra-github-pr-trigger:
318 trigger-phrase: '^remerge$'
319 only-trigger-phrase: true
320 status-context: 'JJB Merge'
323 github-org: '{github-org}'
324 github_pr_whitelist: '{obj:github_pr_whitelist}'
325 github_pr_admin_list: '{obj:github_pr_admin_list}'
327 ########################
328 # Maven Javadoc Verify #
329 ########################
331 - lf_maven_javadoc_verify: &lf_maven_javadoc_verify
332 name: lf-maven-javadoc-verify
334 # Produces javadocs for a Maven project.
336 # Expects javadocs to be available in $WORKSPACE/target/site/apidocs
338 # Required parameters:
339 # build-node: The node to run build on.
340 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
341 # be configured in defaults.yaml)
342 # mvn-settings: The name of settings file containing credentials for
345 # Optional parameters:
347 # :branch: The branch to build against. (default: master)
348 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
349 # :build-timeout: Timeout in seconds before aborting build. (default: 60)
350 # :deploy-path: The path in Nexus to deploy javadoc to. (default: $PROJECT/$STREAM)
351 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
352 # :java-version: Version of Java to use for the build. (default: openjdk8)
353 # :mvn-global-settings: The name of the Maven global settings to use for
354 # Maven configuration. (default: global-settings)
355 # :mvn-opts: Sets MAVEN_OPTS. (default: '')
356 # :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
357 # :mvn-version: Version of maven to use. (default: mvn33)
358 # :submodule-recursive: Whether to checkout submodules recursively.
361 # :gerrit_javadoc_verify_triggers: Override Gerrit Triggers.
363 ######################
364 # Default parameters #
365 ######################
368 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
370 git-url: '$GIT_URL/$PROJECT'
371 java-version: openjdk8
372 mvn-global-settings: global-settings
377 submodule-recursive: true
379 gerrit_javadoc_verify_triggers:
380 - patchset-created-event:
381 exclude-drafts: false
382 exclude-trivial-rebase: false
383 exclude-no-code-change: false
384 - draft-published-event
385 - comment-added-contains-event:
386 comment-contains-value: recheck$
388 #####################
389 # Job Configuration #
390 #####################
394 mvn-version: '{mvn-version}'
395 - lf-provide-maven-settings:
396 global-settings-file: '{mvn-global-settings}'
397 settings-file: '{mvn-settings}'
398 - shell: !include-raw-escape:
399 - ../shell/common-variables.sh
400 - ../shell/maven-javadoc-generate.sh
401 - lf-provide-maven-settings-cleanup
404 name: '{project-name}-maven-javadoc-verify-{stream}'
405 id: gerrit-maven-javadoc-verify
407 # yamllint disable-line rule:key-duplicates
408 <<: *lf_maven_javadoc_verify
411 - lf-infra-gerrit-scm:
412 jenkins-ssh-credential: '{jenkins-ssh-credential}'
414 refspec: '$GERRIT_REFSPEC'
415 branch: '$GERRIT_BRANCH'
416 submodule-recursive: '{submodule-recursive}'
417 choosing-strategy: gerrit
421 server-name: '{gerrit-server-name}'
422 trigger-on: '{obj:gerrit_javadoc_verify_triggers}'
424 - project-compare-type: ANT
425 project-pattern: '{project}'
427 - branch-compare-type: ANT
428 branch-pattern: '**/{branch}'
431 name: '{project-name}-maven-javadoc-verify-{stream}'
432 id: github-maven-javadoc-verify
434 # yamllint disable-line rule:key-duplicates
435 <<: *lf_maven_javadoc_verify
439 url: '{git-url}/{github-org}/{project}'
442 - lf-infra-github-scm:
443 url: '{git-clone-url}{github-org}/{project}'
444 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
446 submodule-recursive: '{submodule-recursive}'
447 choosing-strategy: default
448 jenkins-ssh-credential: '{jenkins-ssh-credential}'
451 - lf-infra-github-pr-trigger:
452 trigger-phrase: '^recheck$'
453 only-trigger-phrase: true
454 status-context: 'Maven Javadoc'
460 github_pr_admin_list:
467 - lf_maven_release: &lf_maven_release
468 name: lf-maven-release
470 # Produces a release candidate by creating a staging repo in Nexus.
472 # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
473 # directory can then be reused later to deploy to Nexus.
475 # Required parameters:
476 # build-node: The node to run build on.
477 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
478 # be configured in defaults.yaml)
479 # mvn-settings: The name of settings file containing credentials for
481 # staging-profile-id: Profile ID of the project's Nexus staging profile.
483 # Optional parameters:
484 # :gerrit_verify_triggers: Override Gerrit Triggers.
485 # :mvn-global-settings: The name of the Maven global settings to use for
486 # Maven configuration. (default: global-settings)
487 # :cron: Cron schedule when to trigger the job. This parameter also
488 # supports multiline input via YAML pipe | character in cases where
489 # one may want to provide more than 1 cron timer. (default: '')
491 ######################
492 # Default parameters #
493 ######################
496 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
498 git-url: '$GIT_URL/$PROJECT'
499 java-version: openjdk8
500 mvn-global-settings: global-settings
505 submodule-recursive: true
508 gerrit_release_triggers:
509 - comment-added-contains-event:
510 comment-contains-value: build release$
512 #####################
513 # Job Configuration #
514 #####################
517 - lf-jacoco-nojava-workaround
519 mvn-version: '{mvn-version}'
520 - lf-provide-maven-settings:
521 global-settings-file: '{mvn-global-settings}'
522 settings-file: '{mvn-settings}'
523 - lf-infra-create-netrc:
524 server-id: opendaylight-staging
525 - shell: !include-raw-escape:
526 - ../shell/lftools-install.sh
527 - ../shell/common-variables.sh
528 - ../shell/maven-patch-release.sh
529 - ../shell/maven-build.sh
530 - ../shell/maven-stage.sh
531 - lf-provide-maven-settings-cleanup
534 name: '{project-name}-maven-release-{stream}'
535 id: gerrit-maven-release
537 # yamllint disable-line rule:key-duplicates
538 <<: *lf_maven_release
541 - lf-infra-gerrit-scm:
542 jenkins-ssh-credential: '{jenkins-ssh-credential}'
544 refspec: '$GERRIT_REFSPEC'
545 branch: '$GERRIT_BRANCH'
546 submodule-recursive: '{submodule-recursive}'
547 choosing-strategy: default
550 - timed: '{obj:cron}'
552 server-name: '{gerrit-server-name}'
553 trigger-on: '{obj:gerrit_release_triggers}'
555 - project-compare-type: ANT
556 project-pattern: '{project}'
558 - branch-compare-type: ANT
559 branch-pattern: '**/{branch}'
562 name: '{project-name}-maven-release-{stream}'
563 id: github-maven-release
565 # yamllint disable-line rule:key-duplicates
566 <<: *lf_maven_release
570 url: '{git-url}/{github-org}/{project}'
573 - lf-infra-github-scm:
574 url: '{git-clone-url}{github-org}/{project}'
575 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
577 submodule-recursive: '{submodule-recursive}'
578 choosing-strategy: default
579 jenkins-ssh-credential: '{jenkins-ssh-credential}'
582 - timed: '{obj:cron}'
583 - lf-infra-github-pr-trigger:
584 trigger-phrase: '^build release$'
585 only-trigger-phrase: true
586 status-context: 'Maven Release'
592 github_pr_admin_list:
599 - lf_maven_sonar: &lf_maven_sonar
602 # Sonar job which runs mvn clean install then publishes to Sonar.
604 # This job purposely only runs on the master branch as there are Additional
605 # configuration needed to support multiple branches and there's not much
606 # interest in that kind of support.
608 # Required parameters:
610 # :build-node: The node to run build on.
611 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
612 # be configured in defaults.yaml)
613 # :mvn-settings: The name of settings file containing credentials for
616 # Optional parameters:
618 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
619 # :build-timeout: Timeout in seconds before aborting build. (default: 60)
620 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
621 # :java-version: Version of Java to use for the build. (default: openjdk8)
622 # :mvn-global-settings: The name of the Maven global settings to use for
623 # Maven configuration. (default: global-settings)
624 # :mvn-opts: Sets MAVEN_OPTS. (default: '')
625 # :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
626 # :mvn-version: Version of maven to use. (default: mvn33)
627 # :submodule-recursive: Whether to checkout submodules recursively.
630 # :gerrit_sonar_triggers: Override Gerrit Triggers.
632 ######################
633 # Default parameters #
634 ######################
636 branch: master # Sonar should always be run on master branch
637 build-days-to-keep: 7
639 git-url: '$GIT_URL/$PROJECT'
640 java-version: openjdk8
641 mvn-global-settings: global-settings
646 submodule-recursive: true
648 gerrit_sonar_triggers:
649 - comment-added-contains-event:
650 comment-contains-value: run-sonar$
652 # Staging repos do not make sense for CLM jobs so set it blank.
653 staging-profile-id: ''
655 #####################
656 # Job Configuration #
657 #####################
662 server-name: '{gerrit-server-name}'
663 trigger-on: '{obj:gerrit_sonar_triggers}'
665 - project-compare-type: 'ANT'
666 project-pattern: '{project}'
668 - branch-compare-type: 'ANT'
669 branch-pattern: '**/master'
677 - lf-infra-maven-sonar:
678 mvn-settings: '{mvn-settings}'
679 mvn-version: '{mvn-version}'
687 name: lf-infra-maven-sonar
688 # Run a Sonar build with Maven
691 mvn-version: '{mvn-version}'
693 # Switch this to the sonar wrapper when JJB 2.0 is available
694 properties-content: |
695 SONAR_HOST_URL=$SONAR_URL
696 SONAR_MAVEN_GOAL=sonar:sonar
697 - lf-provide-maven-settings:
698 global-settings-file: global-settings
699 settings-file: '{mvn-settings}'
700 - shell: !include-raw-escape:
701 - ../shell/common-variables.sh
702 - ../shell/maven-sonar.sh
703 - lf-provide-maven-settings-cleanup
706 name: '{project-name}-sonar'
707 id: gerrit-maven-sonar
709 # yamllint disable-line rule:key-duplicates
713 - lf-infra-gerrit-scm:
714 jenkins-ssh-credential: '{jenkins-ssh-credential}'
716 refspec: $GERRIT_REFSPEC
717 branch: $GERRIT_BRANCH
718 submodule-recursive: '{submodule-recursive}'
719 choosing-strategy: default
722 name: '{project-name}-sonar'
723 id: github-maven-sonar
725 # yamllint disable-line rule:key-duplicates
730 url: '{git-url}/{github-org}/{project}'
733 - lf-infra-github-scm:
734 url: '{git-clone-url}{github-org}/{project}'
735 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
737 submodule-recursive: '{submodule-recursive}'
738 choosing-strategy: default
739 jenkins-ssh-credential: '{jenkins-ssh-credential}'
742 - lf-infra-github-pr-trigger:
743 trigger-phrase: '^recheck$'
744 only-trigger-phrase: false
745 status-context: 'Maven Verify'
751 github_pr_admin_list:
758 - lf_maven_verify: &lf_maven_verify
759 name: lf-maven-verify
761 # Verify job which runs mvn clean install to test a project build..
763 # Required parameters:
765 # :build-node: The node to run build on.
766 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
767 # be configured in defaults.yaml)
768 # :mvn-settings: The name of settings file containing credentials for
771 # Optional parameters:
773 # :branch: Git branch to fetch for the build. (default: master)
774 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
775 # :build-timeout: Timeout in seconds before aborting build. (default: 60)
776 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
777 # :java-version: Version of Java to use for the build. (default: openjdk8)
778 # :mvn-global-settings: The name of the Maven global settings to use for
779 # Maven configuration. (default: global-settings)
780 # :mvn-opts: Sets MAVEN_OPTS. (default: '')
781 # :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
782 # :mvn-version: Version of maven to use. (default: mvn33)
783 # :stream: Keyword that can be used to represent a release code-name.
784 # Often the same as the branch. (default: master)
785 # :submodule-recursive: Whether to checkout submodules recursively.
788 # :gerrit_verify_triggers: Override Gerrit Triggers.
789 # :gerrit_trigger_file_paths: Override file paths which can be used to
790 # filter which file modifications will trigger a build.
792 ######################
793 # Default parameters #
794 ######################
797 build-days-to-keep: 7
799 git-url: '$GIT_URL/$PROJECT'
800 java-version: openjdk8
801 mvn-global-settings: global-settings
803 mvn-params: '-Dstream=$STREAM'
806 submodule-recursive: true
808 gerrit_verify_triggers:
809 - patchset-created-event:
810 exclude-drafts: false
811 exclude-trivial-rebase: false
812 exclude-no-code-change: false
813 - draft-published-event
814 - comment-added-contains-event:
815 comment-contains-value: recheck$
816 gerrit_trigger_file_paths:
820 #####################
821 # Job Configuration #
822 #####################
827 - lf-jacoco-nojava-workaround
829 mvn-version: '{mvn-version}'
830 - lf-provide-maven-settings:
831 global-settings-file: '{mvn-global-settings}'
832 settings-file: '{mvn-settings}'
833 - shell: !include-raw-escape:
834 - ../shell/lftools-install.sh
835 - ../shell/common-variables.sh
836 - ../shell/maven-build.sh
837 - lf-provide-maven-settings-cleanup
845 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
846 id: gerrit-maven-verify
848 # yamllint disable-line rule:key-duplicates
852 - lf-infra-gerrit-scm:
853 jenkins-ssh-credential: '{jenkins-ssh-credential}'
855 refspec: '$GERRIT_REFSPEC'
856 branch: '$GERRIT_BRANCH'
857 submodule-recursive: '{submodule-recursive}'
858 choosing-strategy: gerrit
862 server-name: '{gerrit-server-name}'
863 trigger-on: '{obj:gerrit_verify_triggers}'
865 - project-compare-type: ANT
866 project-pattern: '{project}'
868 - branch-compare-type: ANT
869 branch-pattern: '**/{branch}'
870 file-paths: '{obj:gerrit_trigger_file_paths}'
873 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
874 id: github-maven-verify
876 # yamllint disable-line rule:key-duplicates
881 url: '{git-url}/{github-org}/{project}'
884 - lf-infra-github-scm:
885 url: '{git-clone-url}{github-org}/{project}'
886 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
888 submodule-recursive: '{submodule-recursive}'
889 choosing-strategy: default
890 jenkins-ssh-credential: '{jenkins-ssh-credential}'
893 - lf-infra-github-pr-trigger:
894 trigger-phrase: '^recheck$'
895 only-trigger-phrase: false
896 status-context: 'Maven Verify'
902 github_pr_admin_list: