Merge "Add stable/nitrogen branch for puppet-odl"
[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     # Job template for ODL integration verify jobs
71     #
72     # This is similar to a normal verify job, but it runs
73     # when a project that's a dependency of your project
74     # is successfully built.
75     #
76     # Required Variables:
77     #     stream:    release stream (eg. boron or carbon)
78     #     branch:    git branch (eg. stable/boron or master)
79
80     project-type: freestyle
81     node: '{build-node}'
82     jdk: '{jdk}'
83
84     properties:
85       - opendaylight-infra-properties:
86           build-days-to-keep: '{build-days-to-keep}'
87
88     parameters:
89       - opendaylight-infra-parameters:
90           os-cloud: '{os-cloud}'
91           project: '{project}'
92           branch: '{branch}'
93           refspec: 'refs/heads/{branch}'
94           artifacts: '{archive-artifacts}'
95
96     scm:
97       - git-scm:
98           refspec: ''
99           branch: '{branch}'
100
101     wrappers:
102       - opendaylight-infra-wrappers:
103           build-timeout: '{build-timeout}'
104
105     triggers:
106       - reverse:
107           jobs: '{dependencies}'
108           result: 'success'
109
110     builders:
111       - jacoco-nojava-workaround
112       - provide-maven-settings:
113           global-settings-file: 'global-settings'
114           settings-file: '{mvn-settings}'
115       - maven-target:
116           maven-version: 'mvn33'
117           goals: |
118               {mvn-goals}
119               {opendaylight-infra-mvn-opts}
120           java-opts:
121             - '{mvn-opts}'
122           settings: '{mvn-settings}'
123           settings-type: cfp
124           global-settings: 'global-settings'
125           global-settings-type: cfp
126
127     publishers:
128       - email-notification:
129           email-recipients: '{email-recipients}'
130           email-prefix: '{email-upstream}'
131       - findbugs
132       - jacoco-report
133       - lf-infra-publish
134
135 - job-template:
136     name: '{project-name}-merge-{stream}'
137
138     # Job template for ODL merge jobs
139     #
140     # The purpose of this job template is to setup a ODL merge job
141     # and deploy artifacts to Nexus.
142     #
143     # Required Variables:
144     #     stream:    release stream (eg. boron or carbon)
145     #     branch:    git branch (eg. stable/boron or master)
146
147     # Need to keep jobs that deploy to Nexus at end of build as Maven
148     # projects. Maybe reconsider this once upstream moves deploy to a
149     # separate lifecycle:
150     #     https://issues.apache.org/jira/browse/MNG-5666
151     project-type: maven
152     node: '{build-node}'
153     jdk: '{jdk}'
154
155     properties:
156       - opendaylight-infra-properties:
157           build-days-to-keep: 14
158
159     parameters:
160       - opendaylight-infra-parameters:
161           os-cloud: '{os-cloud}'
162           project: '{project}'
163           branch: '{branch}'
164           refspec: 'refs/heads/{branch}'
165           artifacts: '{archive-artifacts}'
166       - string:
167           name: STREAM
168           default: '{stream}'
169           description: "String representing release name"
170
171     scm:
172       - gerrit-trigger-scm:
173           refspec: ''
174           choosing-strategy: 'default'
175
176     wrappers:
177       - opendaylight-infra-wrappers:
178           build-timeout: '{build-timeout}'
179
180     triggers:
181       - timed: 'H H * * 0'
182       - gerrit-trigger-patch-merged:
183           server-name: '{server-name}'
184           name: '{project}'
185           branch: '{branch}'
186
187     prebuilders:
188       - jacoco-nojava-workaround
189       - provide-maven-settings:
190           global-settings-file: 'global-settings'
191           settings-file: '{mvn-settings}'
192
193     # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
194     maven:
195       maven-name: 'mvn33'
196       goals: >
197           {mvn-goals}
198           -Dmerge
199           -Dstream={stream}
200           {opendaylight-infra-mvn-opts}
201       maven-opts: '{mvn-opts}'
202       settings: '{mvn-settings}'
203       settings-type: cfp
204       global-settings: 'global-settings'
205       global-settings-type: cfp
206       post-step-run-condition: UNSTABLE
207
208     postbuilders:
209       - conditional-step:
210           condition-kind: file-exists
211           condition-filename: deploy-site.xml
212           condition-basedir: workspace
213
214           # The strategy here is intentional to run Maven site:deploy twice
215           # once using regular pom.xml to produce a staged-site which is
216           # then used by deploy-site.xml to push to Nexus. This is a
217           # workaround to Maven Site's default linking code which creates
218           # incorrect URLs for sites due to auto-detection assuming your
219           # project is configured in a certain way which ODL is not.
220           steps:
221             - maven-target:
222                 maven-version: 'mvn33'
223                 pom: pom.xml
224                 goals: 'site:deploy -V -B -Dstream={stream}'
225                 java-opts:
226                   - '-Xmx2g'
227                 settings: '{mvn-settings}'
228                 settings-type: cfp
229                 global-settings: 'global-settings'
230                 global-settings-type: cfp
231             - opendaylight-infra-deploy-maven-site:
232                 settings-file: '{mvn-settings}'
233
234     reporters:
235       - findbugs
236
237     publishers:
238       - email-notification:
239           email-recipients: '{email-recipients}'
240           email-prefix: '[{project-name}]'
241       - maven-deploy:
242           id: ''
243           unique-version: true
244           deploy-unstable: false
245       - jacoco-report
246       - lf-infra-publish
247       - trigger:
248           project: 'distribution-merge-{stream}'
249           threshold: SUCCESS
250
251 - job-template:
252     name: '{project-name}-sonar'
253     disabled: false
254
255     project-type: freestyle
256     node: '{build-node}'
257     jdk: 'openjdk8'
258
259     properties:
260       - opendaylight-infra-properties:
261           build-days-to-keep: 7
262
263     parameters:
264       - opendaylight-infra-parameters:
265           os-cloud: '{os-cloud}'
266           project: '{project}'
267           branch: '{branch}'
268           refspec: 'refs/heads/{branch}'
269           artifacts: '{archive-artifacts}'
270
271     scm:
272       - git-scm:
273           refspec: ''
274           branch: 'master'
275
276     wrappers:
277       - opendaylight-infra-wrappers:
278           build-timeout: '{build-timeout}'
279
280     triggers:
281       - timed: '{schedule-saturday}'
282       - gerrit-trigger-patch-sonar:
283           server-name: '{server-name}'
284           name: '{project}'
285           # FIXME: Make sure this does not alter Gerrit votes, then update docs.
286
287     builders:
288       - jacoco-nojava-workaround
289       - provide-maven-settings:
290           global-settings-file: 'global-settings'
291           settings-file: '{mvn-settings}'
292       - maven-target:
293           maven-version: 'mvn33'
294           goals: |
295               {mvn-goals}
296               -Dsonar
297               {opendaylight-infra-mvn-opts}
298           maven-opts:
299             - '{mvn-opts}'
300           settings: '{mvn-settings}'
301           settings-type: cfp
302           global-settings: 'global-settings'
303           global-settings-type: cfp
304       - maven-target:
305           maven-version: 'mvn33'
306           # We should switch to the recommended configuration of sonar once
307           # JJB adds support for configurating the Sonar wrapper:
308           #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
309           goals: |
310               sonar:sonar
311               -Dsonar
312               -Dsonar.host.url=https://sonar.opendaylight.org
313               {opendaylight-infra-mvn-opts}
314           maven-opts:
315             - '{mvn-opts}'
316           settings: '{mvn-settings}'
317           settings-type: cfp
318           global-settings: 'global-settings'
319           global-settings-type: cfp
320
321     publishers:
322       - email-notification:
323           email-recipients: '{email-recipients}'
324           email-prefix: '[{project-name}]'
325       - jacoco-report
326       - findbugs
327       - lf-infra-publish
328
329 - job-template:
330     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
331
332     # Job template for ODL verify jobs
333     #
334     # The purpose of this job template is to setup a ODL verify job
335     #
336     # Required Variables:
337     #     stream:    release stream (eg. boron or carbon)
338     #     branch:    git branch (eg. stable/boron or master)
339
340     project-type: freestyle
341     node: '{build-node}'
342     concurrent: true
343     jdk: '{jdks}'
344
345     properties:
346       - opendaylight-infra-properties:
347           build-days-to-keep: 7
348
349     parameters:
350       - opendaylight-infra-parameters:
351           os-cloud: '{os-cloud}'
352           project: '{project}'
353           branch: '{branch}'
354           refspec: 'refs/heads/{branch}'
355           artifacts: '{archive-artifacts}'
356
357     scm:
358       - gerrit-trigger-scm:
359           refspec: '$GERRIT_REFSPEC'
360           choosing-strategy: 'gerrit'
361
362     wrappers:
363       - opendaylight-infra-wrappers:
364           build-timeout: '{build-timeout}'
365
366     triggers:
367       - gerrit-trigger-patch-submitted:
368           server: '{server-name}'
369           project: '{project}'
370           branch: '{branch}'
371           files: '**'
372
373     builders:
374       - jacoco-nojava-workaround
375       - provide-maven-settings:
376           global-settings-file: 'global-settings'
377           settings-file: '{mvn-settings}'
378       - maven-target:
379           maven-version: '{mvn-version}'
380           goals: |
381               {mvn-goals}
382               -Dstream={stream}
383               {opendaylight-infra-mvn-opts}
384           java-opts:
385             - '{mvn-opts}'
386           settings: '{mvn-settings}'
387           settings-type: cfp
388           global-settings: 'global-settings'
389           global-settings-type: cfp
390
391     publishers:
392       - findbugs
393       - email-notification:
394           email-recipients: '{email-recipients}'
395           email-prefix: '[{project-name}]'
396       - jacoco-report
397       - lf-infra-publish