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:
76 mvn-opts: '{mvn-opts}'
77 mvn-params: '{mvn-params}'
78 mvn-version: '{mvn-version}'
79 # Staging repos do not make sense for CLM jobs so set it blank.
80 staging-profile-id: ''
84 build-timeout: '{build-timeout}'
85 jenkins-ssh-credential: '{jenkins-ssh-credential}'
88 # Build weekly on Saturdays
93 mvn-version: '{mvn-version}'
94 - lf-provide-maven-settings:
95 global-settings-file: '{global-settings-file}'
96 settings-file: '{settings-file}'
97 - shell: !include-raw-escape:
98 - ../shell/lftools-install.sh
99 - ../shell/common-variables.sh
100 - ../shell/sonatype-clm.sh
101 - lf-provide-maven-settings-cleanup
102 - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
104 application-name: '{project-name}'
109 - lf_maven_release: &lf_maven_release
110 name: lf-maven-release
112 # Produces a release candidate by creating a staging repo in Nexus.
114 # Runs a Maven build and deploys to $WORKSPACE/m2repo directory. This
115 # directory can then be reused later to deploy to Nexus.
117 # Required parameters:
118 # build-node: The node to run build on.
119 # jenkins-ssh-credential: Credential to use for SSH. (Generally should
120 # be configured in defaults.yaml)
121 # settings-file: The name of settings file containing credentials for
123 # global-settings-file: The name of the Maven global settings to use for
124 # Maven configuration.
125 # staging-profile-id: Profile ID of the project's Nexus staging profile.
127 project-type: freestyle
129 jdk: '{java-version}'
131 ######################
132 # Default parameters #
133 ######################
137 git-url: '$GIT_URL/$PROJECT'
138 global-settings-file: global-settings
139 java-version: openjdk8
144 submodule-recursive: true
146 #####################
147 # Job Configuration #
148 #####################
151 - lf-infra-properties:
152 # Keep around for 30 days in case a release takes long to get approved.
153 build-days-to-keep: 30
156 - lf-infra-parameters:
160 - lf-infra-maven-parameters:
161 mvn-opts: '{mvn-opts}'
162 mvn-params: '{mvn-params}'
163 mvn-version: '{mvn-version}'
164 staging-profile-id: '{staging-profile-id}'
168 build-timeout: '{build-timeout}'
169 jenkins-ssh-credential: '{jenkins-ssh-credential}'
172 - lf-jacoco-nojava-workaround
174 mvn-version: '{mvn-version}'
175 - lf-provide-maven-settings:
176 global-settings-file: '{global-settings-file}'
177 settings-file: '{settings-file}'
178 - lf-infra-create-netrc:
179 server-id: opendaylight-staging
180 - shell: !include-raw-escape:
181 - ../shell/lftools-install.sh
182 - ../shell/common-variables.sh
183 - ../shell/maven-patch-release.sh
184 - ../shell/maven-build.sh
185 - ../shell/maven-stage.sh
186 - lf-provide-maven-settings-cleanup
189 # TODO: Make email notification work.
190 # - lf-infra-email-notify:
191 # email-recipients: '{email-recipients}'
192 # email-prefix: '[releng]'
201 name: '{project-name}-maven-clm-{stream}'
206 - lf-infra-gerrit-scm:
207 jenkins-ssh-credential: '{jenkins-ssh-credential}'
209 refspec: '$GERRIT_REFSPEC'
210 branch: '$GERRIT_BRANCH'
211 submodule-recursive: '{submodule-recursive}'
212 choosing-strategy: default
215 name: '{project-name}-maven-clm-{stream}'
221 url: '{git-url}/{github-org}/{project}'
224 - lf-infra-github-scm:
225 url: '{git-clone-url}{github-org}/{project}'
226 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
228 submodule-recursive: '{submodule-recursive}'
229 choosing-strategy: default
230 jenkins-ssh-credential: '{jenkins-ssh-credential}'
233 name: '{project-name}-maven-release-{stream}'
234 id: gerrit-maven-release
235 <<: *lf_maven_release
238 - lf-infra-gerrit-scm:
239 jenkins-ssh-credential: '{jenkins-ssh-credential}'
241 refspec: '$GERRIT_REFSPEC'
242 branch: '$GERRIT_BRANCH'
243 submodule-recursive: '{submodule-recursive}'
244 choosing-strategy: default
247 name: '{project-name}-maven-release-{stream}'
248 id: github-maven-release
249 <<: *lf_maven_release
253 url: '{git-url}/{github-org}/{project}'
256 - lf-infra-github-scm:
257 url: '{git-clone-url}{github-org}/{project}'
258 refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
260 submodule-recursive: '{submodule-recursive}'
261 choosing-strategy: default
262 jenkins-ssh-credential: '{jenkins-ssh-credential}'