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_common: &lf_maven_common
31 project-type: freestyle
36 - lf-infra-properties:
37 build-days-to-keep: '{build-days-to-keep}'
40 - lf-infra-parameters:
44 - lf-infra-maven-parameters:
45 mvn-opts: '{mvn-opts}'
46 mvn-params: '{mvn-params}'
47 mvn-version: '{mvn-version}'
48 # Staging repos do not make sense for CLM jobs so set it blank.
49 staging-profile-id: '{staging-profile-id}'
53 build-timeout: '{build-timeout}'
54 jenkins-ssh-credential: '{jenkins-ssh-credential}'
57 # TODO: Make email notification work.
58 # - lf-infra-email-notify:
59 # email-recipients: '{email-recipients}'
60 # email-prefix: '[releng]'
67 - lf_maven_clm: &lf_maven_clm
70 # Produces a CLM scan of the code into Nexus IQ Server.
72 # Required parameters:
73 # build-node: The node to run build on.
74 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
75 # be configured in defaults.yaml)
76 # mvn-settings: The name of settings file containing credentials for
79 # Optional parameters:
80 # mvn-global-settings: The name of the Maven global settings to use for
81 # Maven configuration. (default: global-settings)
83 ######################
84 # Default parameters #
85 ######################
88 build-days-to-keep: 30 # 30 days for troubleshooting purposes
90 git-url: '$GIT_URL/$PROJECT'
91 java-version: openjdk8
92 mvn-global-settings: global-settings
97 submodule-recursive: true
99 # Staging repos do not make sense for CLM jobs so set it blank.
100 staging-profile-id: ''
102 #####################
103 # Job Configuration #
104 #####################
107 # Build weekly on Saturdays
112 mvn-version: '{mvn-version}'
113 - lf-provide-maven-settings:
114 global-settings-file: '{mvn-global-settings}'
115 settings-file: '{mvn-settings}'
116 - shell: !include-raw-escape:
117 - ../shell/lftools-install.sh
118 - ../shell/common-variables.sh
119 - ../shell/sonatype-clm.sh
120 - lf-provide-maven-settings-cleanup
121 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
123 application-name: '{project-name}'
126 name: '{project-name}-maven-clm-{stream}'
129 # yamllint disable-line rule:key-duplicates
133 - lf-infra-gerrit-scm:
134 jenkins-ssh-credential: '{jenkins-ssh-credential}'
136 refspec: '$GERRIT_REFSPEC'
137 branch: '$GERRIT_BRANCH'
138 submodule-recursive: '{submodule-recursive}'
139 choosing-strategy: default
142 name: '{project-name}-maven-clm-{stream}'
145 # yamllint disable-line rule:key-duplicates
150 url: '{git-url}/{github-org}/{project}'
153 - lf-infra-github-scm:
154 url: '{git-clone-url}{github-org}/{project}'
155 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
157 submodule-recursive: '{submodule-recursive}'
158 choosing-strategy: default
159 jenkins-ssh-credential: '{jenkins-ssh-credential}'
165 - lf_maven_release: &lf_maven_release
166 name: lf-maven-release
168 # Produces a release candidate by creating a staging repo in Nexus.
170 # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
171 # directory can then be reused later to deploy to Nexus.
173 # Required parameters:
174 # build-node: The node to run build on.
175 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
176 # be configured in defaults.yaml)
177 # mvn-settings: The name of settings file containing credentials for
179 # staging-profile-id: Profile ID of the project's Nexus staging profile.
181 # Optional parameters:
182 # mvn-global-settings: The name of the Maven global settings to use for
183 # Maven configuration. (default: global-settings)
185 ######################
186 # Default parameters #
187 ######################
190 build-days-to-keep: 30 # 30 days in case a release takes long to get approved.
192 git-url: '$GIT_URL/$PROJECT'
193 java-version: openjdk8
194 mvn-global-settings: global-settings
199 submodule-recursive: true
201 #####################
202 # Job Configuration #
203 #####################
206 - lf-jacoco-nojava-workaround
208 mvn-version: '{mvn-version}'
209 - lf-provide-maven-settings:
210 global-settings-file: '{mvn-global-settings}'
211 settings-file: '{mvn-settings}'
212 - lf-infra-create-netrc:
213 server-id: opendaylight-staging
214 - shell: !include-raw-escape:
215 - ../shell/lftools-install.sh
216 - ../shell/common-variables.sh
217 - ../shell/maven-patch-release.sh
218 - ../shell/maven-build.sh
219 - ../shell/maven-stage.sh
220 - lf-provide-maven-settings-cleanup
223 name: '{project-name}-maven-release-{stream}'
224 id: gerrit-maven-release
226 # yamllint disable-line rule:key-duplicates
227 <<: *lf_maven_release
230 - lf-infra-gerrit-scm:
231 jenkins-ssh-credential: '{jenkins-ssh-credential}'
233 refspec: '$GERRIT_REFSPEC'
234 branch: '$GERRIT_BRANCH'
235 submodule-recursive: '{submodule-recursive}'
236 choosing-strategy: default
239 name: '{project-name}-maven-release-{stream}'
240 id: github-maven-release
242 # yamllint disable-line rule:key-duplicates
243 <<: *lf_maven_release
247 url: '{git-url}/{github-org}/{project}'
250 - lf-infra-github-scm:
251 url: '{git-clone-url}{github-org}/{project}'
252 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
254 submodule-recursive: '{submodule-recursive}'
255 choosing-strategy: default
256 jenkins-ssh-credential: '{jenkins-ssh-credential}'