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
15 name: '{project-name}-github-maven-jobs'
17 # This job group contains all the recommended jobs that should be deployed
18 # for any project ci that is using github.
22 - github-maven-release
28 - lf_maven_clm: &lf_maven_clm
31 # Produces a CLM scan of the code into Nexus IQ Server.
33 # Required parameters:
34 # build-node: The node to run build on.
35 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
36 # be configured in defaults.yaml)
37 # mvn-settings: The name of settings file containing credentials for
40 # Optional parameters:
41 # mvn-global-settings: The name of the Maven global settings to use for
42 # Maven configuration. (default: global-settings)
44 project-type: freestyle
48 ######################
49 # Default parameters #
50 ######################
54 git-url: '$GIT_URL/$PROJECT'
55 java-version: openjdk8
56 mvn-global-settings: global-settings
61 submodule-recursive: true
68 - lf-infra-properties:
69 # Keep around for 30 days for troubleshooting purposes.
70 build-days-to-keep: 30
73 - lf-infra-parameters:
77 - lf-infra-maven-parameters:
78 mvn-opts: '{mvn-opts}'
79 mvn-params: '{mvn-params}'
80 mvn-version: '{mvn-version}'
81 # Staging repos do not make sense for CLM jobs so set it blank.
82 staging-profile-id: ''
86 build-timeout: '{build-timeout}'
87 jenkins-ssh-credential: '{jenkins-ssh-credential}'
90 # Build weekly on Saturdays
95 mvn-version: '{mvn-version}'
96 - lf-provide-maven-settings:
97 global-settings-file: '{mvn-global-settings}'
98 settings-file: '{mvn-settings}'
99 - shell: !include-raw-escape:
100 - ../shell/lftools-install.sh
101 - ../shell/common-variables.sh
102 - ../shell/sonatype-clm.sh
103 - lf-provide-maven-settings-cleanup
104 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
106 application-name: '{project-name}'
111 - lf_maven_release: &lf_maven_release
112 name: lf-maven-release
114 # Produces a release candidate by creating a staging repo in Nexus.
116 # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
117 # directory can then be reused later to deploy to Nexus.
119 # Required parameters:
120 # build-node: The node to run build on.
121 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
122 # be configured in defaults.yaml)
123 # mvn-settings: The name of settings file containing credentials for
125 # staging-profile-id: Profile ID of the project's Nexus staging profile.
127 # Optional parameters:
128 # mvn-global-settings: The name of the Maven global settings to use for
129 # Maven configuration. (default: global-settings)
131 project-type: freestyle
133 jdk: '{java-version}'
135 ######################
136 # Default parameters #
137 ######################
141 git-url: '$GIT_URL/$PROJECT'
142 java-version: openjdk8
143 mvn-global-settings: global-settings
148 submodule-recursive: true
150 #####################
151 # Job Configuration #
152 #####################
155 - lf-infra-properties:
156 # Keep around for 30 days in case a release takes long to get approved.
157 build-days-to-keep: 30
160 - lf-infra-parameters:
164 - lf-infra-maven-parameters:
165 mvn-opts: '{mvn-opts}'
166 mvn-params: '{mvn-params}'
167 mvn-version: '{mvn-version}'
168 staging-profile-id: '{staging-profile-id}'
172 build-timeout: '{build-timeout}'
173 jenkins-ssh-credential: '{jenkins-ssh-credential}'
176 - lf-jacoco-nojava-workaround
178 mvn-version: '{mvn-version}'
179 - lf-provide-maven-settings:
180 global-settings-file: '{mvn-global-settings}'
181 settings-file: '{mvn-settings}'
182 - lf-infra-create-netrc:
183 server-id: opendaylight-staging
184 - shell: !include-raw-escape:
185 - ../shell/lftools-install.sh
186 - ../shell/common-variables.sh
187 - ../shell/maven-patch-release.sh
188 - ../shell/maven-build.sh
189 - ../shell/maven-stage.sh
190 - lf-provide-maven-settings-cleanup
193 # TODO: Make email notification work.
194 # - lf-infra-email-notify:
195 # email-recipients: '{email-recipients}'
196 # email-prefix: '[releng]'
205 name: '{project-name}-maven-clm-{stream}'
210 - lf-infra-gerrit-scm:
211 jenkins-ssh-credential: '{jenkins-ssh-credential}'
213 refspec: '$GERRIT_REFSPEC'
214 branch: '$GERRIT_BRANCH'
215 submodule-recursive: '{submodule-recursive}'
216 choosing-strategy: default
219 name: '{project-name}-maven-clm-{stream}'
225 url: '{git-url}/{github-org}/{project}'
228 - lf-infra-github-scm:
229 url: '{git-clone-url}{github-org}/{project}'
230 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
232 submodule-recursive: '{submodule-recursive}'
233 choosing-strategy: default
234 jenkins-ssh-credential: '{jenkins-ssh-credential}'
237 name: '{project-name}-maven-release-{stream}'
238 id: gerrit-maven-release
239 <<: *lf_maven_release
242 - lf-infra-gerrit-scm:
243 jenkins-ssh-credential: '{jenkins-ssh-credential}'
245 refspec: '$GERRIT_REFSPEC'
246 branch: '$GERRIT_BRANCH'
247 submodule-recursive: '{submodule-recursive}'
248 choosing-strategy: default
251 name: '{project-name}-maven-release-{stream}'
252 id: github-maven-release
253 <<: *lf_maven_release
257 url: '{git-url}/{github-org}/{project}'
260 - lf-infra-github-scm:
261 url: '{git-clone-url}{github-org}/{project}'
262 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
264 submodule-recursive: '{submodule-recursive}'
265 choosing-strategy: default
266 jenkins-ssh-credential: '{jenkins-ssh-credential}'