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 # settings-file: The name of settings file containing credentials for
39 # global-settings-file: The name of the Maven global settings to use for
40 # Maven configuration.
42 project-type: freestyle
46 ######################
47 # Default parameters #
48 ######################
52 git-url: '$GIT_URL/$PROJECT'
53 global-settings-file: global-settings
54 java-version: openjdk8
59 submodule-recursive: true
66 - lf-infra-properties:
67 # Keep around for 30 days for troubleshooting purposes.
68 build-days-to-keep: 30
71 - lf-infra-parameters:
75 - lf-infra-maven-parameters
79 build-timeout: '{build-timeout}'
80 jenkins-ssh-credential: '{jenkins-ssh-credential}'
84 mvn-version: '{mvn-version}'
85 - lf-provide-maven-settings:
86 global-settings-file: '{global-settings-file}'
87 settings-file: '{settings-file}'
88 - shell: !include-raw-escape:
89 - ../shell/lftools-install.sh
90 - ../shell/common-variables.sh
91 - ../shell/sonatype-clm.sh
92 - lf-provide-maven-settings-cleanup
93 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
95 application-name: '{project-name}'
100 - lf_maven_release: &lf_maven_release
101 name: lf-maven-release
103 # Produces a release candidate by creating a staging repo in Nexus.
105 # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
106 # directory can then be reused later to deploy to Nexus.
108 # Required parameters:
109 # build-node: The node to run build on.
110 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
111 # be configured in defaults.yaml)
112 # settings-file: The name of settings file containing credentials for
114 # global-settings-file: The name of the Maven global settings to use for
115 # Maven configuration.
116 # staging-profile-id: Profile ID of the project's Nexus staging profile.
118 project-type: freestyle
120 jdk: '{java-version}'
122 ######################
123 # Default parameters #
124 ######################
128 git-url: '$GIT_URL/$PROJECT'
129 global-settings-file: global-settings
130 java-version: openjdk8
135 submodule-recursive: true
137 #####################
138 # Job Configuration #
139 #####################
142 - lf-infra-properties:
143 # Keep around for 30 days in case a release takes long to get approved.
144 build-days-to-keep: 30
147 - lf-infra-parameters:
151 - lf-infra-maven-parameters:
152 mvn-opts: '{mvn-opts}'
153 mvn-params: '{mvn-params}'
154 mvn-version: '{mvn-version}'
155 staging-profile-id: '{staging-profile-id}'
159 build-timeout: '{build-timeout}'
160 jenkins-ssh-credential: '{jenkins-ssh-credential}'
163 - lf-jacoco-nojava-workaround
165 mvn-version: '{mvn-version}'
166 - lf-provide-maven-settings:
167 global-settings-file: '{global-settings-file}'
168 settings-file: '{settings-file}'
169 - lf-infra-create-netrc:
170 server-id: opendaylight-staging
171 - shell: !include-raw-escape:
172 - ../shell/lftools-install.sh
173 - ../shell/common-variables.sh
174 - ../shell/maven-patch-release.sh
175 - ../shell/maven-build.sh
176 - ../shell/maven-stage.sh
177 - lf-provide-maven-settings-cleanup
180 # TODO: Make email notification work.
181 # - lf-infra-email-notify:
182 # email-recipients: '{email-recipients}'
183 # email-prefix: '[releng]'
192 name: '{project-name}-maven-clm-{stream}'
197 - lf-infra-gerrit-scm:
198 jenkins-ssh-credential: '{jenkins-ssh-credential}'
200 refspec: '$GERRIT_REFSPEC'
201 branch: '$GERRIT_BRANCH'
202 submodule-recursive: '{submodule-recursive}'
203 choosing-strategy: default
206 name: '{project-name}-maven-clm-{stream}'
212 url: '{git-url}/{github-org}/{project}'
215 - lf-infra-github-scm:
216 url: '{git-clone-url}{github-org}/{project}'
217 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
219 submodule-recursive: '{submodule-recursive}'
220 choosing-strategy: default
221 jenkins-ssh-credential: '{jenkins-ssh-credential}'
224 name: '{project-name}-maven-release-{stream}'
225 id: gerrit-maven-release
226 <<: *lf_maven_release
229 - lf-infra-gerrit-scm:
230 jenkins-ssh-credential: '{jenkins-ssh-credential}'
232 refspec: '$GERRIT_REFSPEC'
233 branch: '$GERRIT_BRANCH'
234 submodule-recursive: '{submodule-recursive}'
235 choosing-strategy: default
238 name: '{project-name}-maven-release-{stream}'
239 id: github-maven-release
240 <<: *lf_maven_release
244 url: '{git-url}/{github-org}/{project}'
247 - lf-infra-github-scm:
248 url: '{git-clone-url}{github-org}/{project}'
249 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
251 submodule-recursive: '{submodule-recursive}'
252 choosing-strategy: default
253 jenkins-ssh-credential: '{jenkins-ssh-credential}'