Merge "Add job to comprehensively test RPM building logic"
[releng/builder.git] / jjb / releng-templates-java.yaml
1 ---
2 - job-template:
3     # Template used for running CLM scans
4     # Arguements:
5     #   {name}         - Project Shortname
6     #   {project}      - Fully qualified project name
7     #   {mvn-settings} - Project maven settings file
8     #   {stream}
9     #   {jdk}
10     name: '{project-name}-clm-{stream}'
11
12     project-type: freestyle
13     node: '{build-node}'
14     jdk: '{jdk}'
15
16     properties:
17       - opendaylight-infra-properties:
18           build-days-to-keep: '{build-days-to-keep}'
19
20     parameters:
21       - opendaylight-infra-parameters:
22           os-cloud: '{os-cloud}'
23           project: '{project}'
24           branch: '{branch}'
25           refspec: 'refs/heads/{branch}'
26           artifacts: '{archive-artifacts}'
27
28     scm:
29       - git-scm:
30           refspec: ''
31           branch: '{branch}'
32
33     wrappers:
34       - opendaylight-infra-wrappers:
35           build-timeout: '{build-timeout}'
36
37     triggers:
38       - timed: '{schedule-saturday}'
39
40     builders:
41       - provide-maven-settings:
42           global-settings-file: 'global-settings'
43           settings-file: '{mvn-settings}'
44       - maven-target:
45           maven-version: 'mvn33'
46           pom: 'pom.xml'
47           goals: |
48               clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index
49               -Pq
50               {opendaylight-infra-mvn-opts}
51           java-opts:
52             - '-Xmx4096m -XX:MaxPermSize=512m'
53           settings: '{mvn-settings}'
54           settings-type: cfp
55           global-settings: 'global-settings'
56           global-settings-type: cfp
57       - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
58       - check-clm:
59           application-name: '{project-name}'
60
61     publishers:
62       - email-notification:
63           email-recipients: '{email-recipients}'
64           email-prefix: '[{project-name}]'
65       - lf-infra-publish
66
67 - job-template:
68     name: '{project-name}-integration-{stream}'
69
70     project-type: freestyle
71     node: '{build-node}'
72     jdk: '{jdk}'
73
74     properties:
75       - opendaylight-infra-properties:
76           build-days-to-keep: '{build-days-to-keep}'
77
78     parameters:
79       - opendaylight-infra-parameters:
80           os-cloud: '{os-cloud}'
81           project: '{project}'
82           branch: '{branch}'
83           refspec: 'refs/heads/{branch}'
84           artifacts: '{archive-artifacts}'
85
86     scm:
87       - git-scm:
88           refspec: ''
89           branch: '{branch}'
90
91     wrappers:
92       - opendaylight-infra-wrappers:
93           build-timeout: '{build-timeout}'
94
95     triggers:
96       - reverse:
97           jobs: '{dependencies}'
98           result: 'success'
99
100     builders:
101       - jacoco-nojava-workaround
102       - provide-maven-settings:
103           global-settings-file: 'global-settings'
104           settings-file: '{mvn-settings}'
105       - maven-target:
106           maven-version: 'mvn33'
107           goals: |
108               {mvn-goals}
109               {opendaylight-infra-mvn-opts}
110           java-opts:
111             - '{mvn-opts}'
112           settings: '{mvn-settings}'
113           settings-type: cfp
114           global-settings: 'global-settings'
115           global-settings-type: cfp
116
117     publishers:
118       - email-notification:
119           email-recipients: '{email-recipients}'
120           email-prefix: '{email-upstream}'
121       - findbugs
122       - jacoco-report
123       - lf-infra-publish
124
125 - job-template:
126     name: '{project-name}-merge-{stream}'
127
128     # Need to keep jobs that deploy to Nexus at end of build as Maven
129     # projects. Maybe reconsider this once upstream moves deploy to a
130     # separate lifecycle:
131     #     https://issues.apache.org/jira/browse/MNG-5666
132     project-type: maven
133     node: '{build-node}'
134     jdk: '{jdk}'
135
136     properties:
137       - opendaylight-infra-properties:
138           build-days-to-keep: 14
139
140     parameters:
141       - opendaylight-infra-parameters:
142           os-cloud: '{os-cloud}'
143           project: '{project}'
144           branch: '{branch}'
145           refspec: 'refs/heads/{branch}'
146           artifacts: '{archive-artifacts}'
147       - string:
148           name: STREAM
149           default: '{stream}'
150           description: "String representing release name"
151
152     scm:
153       - gerrit-trigger-scm:
154           refspec: ''
155           choosing-strategy: 'default'
156
157     wrappers:
158       - opendaylight-infra-wrappers:
159           build-timeout: '{build-timeout}'
160
161     triggers:
162       - timed: 'H H * * 0'
163       - gerrit-trigger-patch-merged:
164           server-name: '{server-name}'
165           name: '{project}'
166           branch: '{branch}'
167
168     prebuilders:
169       - jacoco-nojava-workaround
170       - provide-maven-settings:
171           global-settings-file: 'global-settings'
172           settings-file: '{mvn-settings}'
173
174     # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
175     maven:
176       maven-name: 'mvn33'
177       goals: >
178           {mvn-goals}
179           -Dmerge
180           -Dstream={stream}
181           {opendaylight-infra-mvn-opts}
182       maven-opts: '{mvn-opts}'
183       settings: '{mvn-settings}'
184       settings-type: cfp
185       global-settings: 'global-settings'
186       global-settings-type: cfp
187       post-step-run-condition: UNSTABLE
188
189     postbuilders:
190       - conditional-step:
191           condition-kind: file-exists
192           condition-filename: deploy-site.xml
193           condition-basedir: workspace
194
195           # The strategy here is intentional to run Maven site:deploy twice
196           # once using regular pom.xml to produce a staged-site which is
197           # then used by deploy-site.xml to push to Nexus. This is a
198           # workaround to Maven Site's default linking code which creates
199           # incorrect URLs for sites due to auto-detection assuming your
200           # project is configured in a certain way which ODL is not.
201           steps:
202             - maven-target:
203                 maven-version: 'mvn33'
204                 pom: pom.xml
205                 goals: 'site:deploy -V -B -Dstream={stream}'
206                 java-opts:
207                   - '-Xmx2g'
208                 settings: '{mvn-settings}'
209                 settings-type: cfp
210                 global-settings: 'global-settings'
211                 global-settings-type: cfp
212             - opendaylight-infra-deploy-maven-site:
213                 settings-file: '{mvn-settings}'
214
215     reporters:
216       - findbugs
217
218     publishers:
219       - email-notification:
220           email-recipients: '{email-recipients}'
221           email-prefix: '[{project-name}]'
222       - maven-deploy:
223           id: ''
224           unique-version: true
225           deploy-unstable: false
226       - jacoco-report
227       - lf-infra-publish
228       - trigger:
229           project: 'distribution-merge-{stream}'
230           threshold: SUCCESS
231
232 - job-template:
233     name: '{project-name}-sonar'
234     disabled: false
235
236     project-type: freestyle
237     node: '{build-node}'
238     jdk: 'openjdk8'
239
240     properties:
241       - opendaylight-infra-properties:
242           build-days-to-keep: 7
243
244     parameters:
245       - opendaylight-infra-parameters:
246           os-cloud: '{os-cloud}'
247           project: '{project}'
248           branch: '{branch}'
249           refspec: 'refs/heads/{branch}'
250           artifacts: '{archive-artifacts}'
251
252     scm:
253       - git-scm:
254           refspec: ''
255           branch: 'master'
256
257     wrappers:
258       - opendaylight-infra-wrappers:
259           build-timeout: '{build-timeout}'
260
261     triggers:
262       - timed: '{schedule-saturday}'
263       - gerrit-trigger-patch-sonar:
264           server-name: '{server-name}'
265           name: '{project}'
266           # FIXME: Make sure this does not alter Gerrit votes, then update docs.
267
268     builders:
269       - jacoco-nojava-workaround
270       - provide-maven-settings:
271           global-settings-file: 'global-settings'
272           settings-file: '{mvn-settings}'
273       - maven-target:
274           maven-version: 'mvn33'
275           goals: |
276               {mvn-goals}
277               -Dsonar
278               {opendaylight-infra-mvn-opts}
279           maven-opts:
280             - '{mvn-opts}'
281           settings: '{mvn-settings}'
282           settings-type: cfp
283           global-settings: 'global-settings'
284           global-settings-type: cfp
285       - maven-target:
286           maven-version: 'mvn33'
287           # We should switch to the recommended configuration of sonar once
288           # JJB adds support for configurating the Sonar wrapper:
289           #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
290           goals: |
291               sonar:sonar
292               -Dsonar
293               -Dsonar.host.url=https://sonar.opendaylight.org
294               {opendaylight-infra-mvn-opts}
295           maven-opts:
296             - '{mvn-opts}'
297           settings: '{mvn-settings}'
298           settings-type: cfp
299           global-settings: 'global-settings'
300           global-settings-type: cfp
301
302     publishers:
303       - email-notification:
304           email-recipients: '{email-recipients}'
305           email-prefix: '[{project-name}]'
306       - jacoco-report
307       - findbugs
308       - lf-infra-publish
309
310 - job-template:
311     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
312
313     project-type: freestyle
314     node: '{build-node}'
315     concurrent: true
316     jdk: '{jdks}'
317
318     properties:
319       - opendaylight-infra-properties:
320           build-days-to-keep: 7
321
322     parameters:
323       - opendaylight-infra-parameters:
324           os-cloud: '{os-cloud}'
325           project: '{project}'
326           branch: '{branch}'
327           refspec: 'refs/heads/{branch}'
328           artifacts: '{archive-artifacts}'
329
330     scm:
331       - gerrit-trigger-scm:
332           refspec: '$GERRIT_REFSPEC'
333           choosing-strategy: 'gerrit'
334
335     wrappers:
336       - opendaylight-infra-wrappers:
337           build-timeout: '{build-timeout}'
338
339     triggers:
340       - gerrit-trigger-patch-submitted:
341           server: '{server-name}'
342           project: '{project}'
343           branch: '{branch}'
344           files: '**'
345
346     builders:
347       - jacoco-nojava-workaround
348       - provide-maven-settings:
349           global-settings-file: 'global-settings'
350           settings-file: '{mvn-settings}'
351       - maven-target:
352           maven-version: '{mvn-version}'
353           goals: |
354               {mvn-goals}
355               -Dstream={stream}
356               {opendaylight-infra-mvn-opts}
357           java-opts:
358             - '{mvn-opts}'
359           settings: '{mvn-settings}'
360           settings-type: cfp
361           global-settings: 'global-settings'
362           global-settings-type: cfp
363
364     publishers:
365       - findbugs
366       - email-notification:
367           email-recipients: '{email-recipients}'
368           email-prefix: '[{project-name}]'
369       - jacoco-report
370       - lf-infra-publish