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
30 - lf_maven_common: &lf_maven_common
33 project-type: freestyle
38 - lf-infra-properties:
39 build-days-to-keep: '{build-days-to-keep}'
42 - lf-infra-parameters:
46 lftools-version: '{lftools-version}'
47 - lf-infra-maven-parameters:
48 mvn-opts: '{mvn-opts}'
49 mvn-params: '{mvn-params}'
50 mvn-version: '{mvn-version}'
51 # Staging repos do not make sense for CLM jobs so set it blank.
52 staging-profile-id: '{staging-profile-id}'
56 build-timeout: '{build-timeout}'
57 jenkins-ssh-credential: '{jenkins-ssh-credential}'
60 # TODO: Make email notification work.
61 # - lf-infra-email-notify:
62 # email-recipients: '{email-recipients}'
63 # email-prefix: '[releng]'
70 - lf_maven_clm: &lf_maven_clm
73 # Produces a CLM scan of the code into Nexus IQ Server.
75 # Required parameters:
76 # build-node: The node to run build on.
77 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
78 # be configured in defaults.yaml)
79 # mvn-settings: The name of settings file containing credentials for
82 # Optional parameters:
83 # mvn-global-settings: The name of the Maven global settings to use for
84 # Maven configuration. (default: global-settings)
86 ######################
87 # Default parameters #
88 ######################
91 build-days-to-keep: 30 # 30 days for troubleshooting purposes
93 git-url: '$GIT_URL/$PROJECT'
94 java-version: openjdk8
95 mvn-global-settings: global-settings
100 submodule-recursive: true
102 # Staging repos do not make sense for CLM jobs so set it blank.
103 staging-profile-id: ''
105 #####################
106 # Job Configuration #
107 #####################
110 # Build weekly on Saturdays
115 mvn-version: '{mvn-version}'
116 - lf-provide-maven-settings:
117 global-settings-file: '{mvn-global-settings}'
118 settings-file: '{mvn-settings}'
119 - shell: !include-raw-escape:
120 - ../shell/common-variables.sh
121 - ../shell/sonatype-clm.sh
122 - lf-provide-maven-settings-cleanup
123 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
125 application-name: '{project-name}'
128 name: '{project-name}-maven-clm-{stream}'
131 # yamllint disable-line rule:key-duplicates
135 - lf-infra-gerrit-scm:
136 jenkins-ssh-credential: '{jenkins-ssh-credential}'
138 refspec: '$GERRIT_REFSPEC'
139 branch: '$GERRIT_BRANCH'
140 submodule-recursive: '{submodule-recursive}'
141 choosing-strategy: default
144 name: '{project-name}-maven-clm-{stream}'
147 # yamllint disable-line rule:key-duplicates
152 url: '{git-url}/{github-org}/{project}'
155 - lf-infra-github-scm:
156 url: '{git-clone-url}{github-org}/{project}'
157 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
159 submodule-recursive: '{submodule-recursive}'
160 choosing-strategy: default
161 jenkins-ssh-credential: '{jenkins-ssh-credential}'
167 - lf_maven_release: &lf_maven_release
168 name: lf-maven-release
170 # Produces a release candidate by creating a staging repo in Nexus.
172 # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
173 # directory can then be reused later to deploy to Nexus.
175 # Required parameters:
176 # build-node: The node to run build on.
177 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
178 # be configured in defaults.yaml)
179 # mvn-settings: The name of settings file containing credentials for
181 # staging-profile-id: Profile ID of the project's Nexus staging profile.
183 # Optional parameters:
184 # mvn-global-settings: The name of the Maven global settings to use for
185 # Maven configuration. (default: global-settings)
187 ######################
188 # Default parameters #
189 ######################
192 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
194 git-url: '$GIT_URL/$PROJECT'
195 java-version: openjdk8
196 mvn-global-settings: global-settings
201 submodule-recursive: true
203 #####################
204 # Job Configuration #
205 #####################
208 - lf-jacoco-nojava-workaround
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: opendaylight-staging
216 - shell: !include-raw-escape:
217 - ../shell/lftools-install.sh
218 - ../shell/common-variables.sh
219 - ../shell/maven-patch-release.sh
220 - ../shell/maven-build.sh
221 - ../shell/maven-stage.sh
222 - lf-provide-maven-settings-cleanup
225 name: '{project-name}-maven-release-{stream}'
226 id: gerrit-maven-release
228 # yamllint disable-line rule:key-duplicates
229 <<: *lf_maven_release
232 - lf-infra-gerrit-scm:
233 jenkins-ssh-credential: '{jenkins-ssh-credential}'
235 refspec: '$GERRIT_REFSPEC'
236 branch: '$GERRIT_BRANCH'
237 submodule-recursive: '{submodule-recursive}'
238 choosing-strategy: default
241 name: '{project-name}-maven-release-{stream}'
242 id: github-maven-release
244 # yamllint disable-line rule:key-duplicates
245 <<: *lf_maven_release
249 url: '{git-url}/{github-org}/{project}'
252 - lf-infra-github-scm:
253 url: '{git-clone-url}{github-org}/{project}'
254 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
256 submodule-recursive: '{submodule-recursive}'
257 choosing-strategy: default
258 jenkins-ssh-credential: '{jenkins-ssh-credential}'
264 - lf_maven_verify: &lf_maven_verify
265 name: lf-maven-verify
267 # Verify job which runs mvn clean install to test a project build..
269 # Required parameters:
271 # :build-node: The node to run build on.
272 # :jenkins-ssh-credential: Credential to use for SSH. (Generally should
273 # be configured in defaults.yaml)
274 # :mvn-settings: The name of settings file containing credentials for
277 # Optional parameters:
279 # :branch: Git branch to fetch for the build. (default: master)
280 # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7)
281 # :build-timeout: Timeout in seconds before aborting build. (default: 60)
282 # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT)
283 # :java-version: Version of Java to use for the build. (default: openjdk8)
284 # :mvn-global-settings: The name of the Maven global settings to use for
285 # Maven configuration. (default: global-settings)
286 # :mvn-opts: Sets MAVEN_OPTS. (default: '')
287 # :mvn-params: Additional mvn parameters to pass to the cli. (default: '')
288 # :mvn-version: Version of maven to use. (default: mvn33)
289 # :stream: Keyword that can be used to represent a release code-name.
290 # Often the same as the branch. (default: master)
291 # :submodule-recursive: Whether to checkout submodules recursively.
294 # :gerrit_verify_triggers: Override Gerrit Triggers.
295 # :gerrit_trigger_file_paths: Override file paths which can be used to
296 # filter which file modifications will trigger a build.
298 ######################
299 # Default parameters #
300 ######################
303 build-days-to-keep: 7
305 git-url: '$GIT_URL/$PROJECT'
306 java-version: openjdk8
307 mvn-global-settings: global-settings
309 mvn-params: '-Dstream=$STREAM'
312 submodule-recursive: true
314 gerrit_verify_triggers:
315 - patchset-created-event:
316 exclude-drafts: false
317 exclude-trivial-rebase: false
318 exclude-no-code-change: false
319 - draft-published-event
320 - comment-added-contains-event:
321 comment-contains-value: recheck$
322 gerrit_trigger_file_paths:
326 #####################
327 # Job Configuration #
328 #####################
333 - lf-jacoco-nojava-workaround
335 mvn-version: '{mvn-version}'
336 - lf-provide-maven-settings:
337 global-settings-file: '{mvn-global-settings}'
338 settings-file: '{mvn-settings}'
339 - shell: !include-raw-escape:
340 - ../shell/lftools-install.sh
341 - ../shell/common-variables.sh
342 - ../shell/maven-build.sh
343 - lf-provide-maven-settings-cleanup
351 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
352 id: gerrit-maven-verify
354 # yamllint disable-line rule:key-duplicates
358 - lf-infra-gerrit-scm:
359 jenkins-ssh-credential: '{jenkins-ssh-credential}'
361 refspec: '$GERRIT_REFSPEC'
362 branch: '$GERRIT_BRANCH'
363 submodule-recursive: '{submodule-recursive}'
364 choosing-strategy: gerrit
368 server-name: '{gerrit-server-name}'
369 trigger-on: '{obj:gerrit_verify_triggers}'
371 - project-compare-type: ANT
372 project-pattern: '{project}'
374 - branch-compare-type: ANT
375 branch-pattern: '**/{branch}'
376 file-paths: '{obj:gerrit_trigger_file_paths}'
379 name: '{project-name}-maven-verify-{stream}-{mvn-version}-{java-version}'
380 id: github-maven-verify
382 # yamllint disable-line rule:key-duplicates
387 url: '{git-url}/{github-org}/{project}'
390 - lf-infra-github-scm:
391 url: '{git-clone-url}{github-org}/{project}'
392 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
394 submodule-recursive: '{submodule-recursive}'
395 choosing-strategy: default
396 jenkins-ssh-credential: '{jenkins-ssh-credential}'
399 - lf-infra-github-pr-trigger:
400 trigger-phrase: '^recheck$'
401 only-trigger-phrase: false
402 status-context: 'Maven Verify'
408 github_pr_admin_list: