Merge "Move GBP openstack branch to newton"
[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: 'H H * * 6'
39
40     builders:
41       - provide-maven-settings:
42           global-settings-file: 'odl-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: 'odl-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       - opendaylight-infra-shiplogs:
66           maven-version: 'mvn33'
67
68 - job-template:
69     name: '{project-name}-integration-{stream}'
70
71     # Job template for ODL integration verify jobs
72     #
73     # This is similar to a normal verify job, but it runs
74     # when a project that's a dependency of your project
75     # is successfully built.
76     #
77     # Required Variables:
78     #     stream:    release stream (eg. boron or carbon)
79     #     branch:    git branch (eg. stable/boron or master)
80
81     project-type: freestyle
82     node: '{build-node}'
83     jdk: '{jdk}'
84
85     properties:
86       - opendaylight-infra-properties:
87           build-days-to-keep: '{build-days-to-keep}'
88
89     parameters:
90       - opendaylight-infra-parameters:
91           os-cloud: '{os-cloud}'
92           project: '{project}'
93           branch: '{branch}'
94           refspec: 'refs/heads/{branch}'
95           artifacts: '{archive-artifacts}'
96
97     scm:
98       - git-scm:
99           refspec: ''
100           branch: '{branch}'
101
102     wrappers:
103       - opendaylight-infra-wrappers:
104           build-timeout: '{build-timeout}'
105
106     triggers:
107       - reverse:
108           jobs: '{dependencies}'
109           result: 'success'
110
111     builders:
112       - jacoco-nojava-workaround
113       - provide-maven-settings:
114           global-settings-file: 'odl-global-settings'
115           settings-file: '{mvn-settings}'
116       - maven-target:
117           maven-version: 'mvn33'
118           goals: |
119               {mvn-goals}
120               {opendaylight-infra-mvn-opts}
121           java-opts:
122             - '{mvn-opts}'
123           settings: '{mvn-settings}'
124           settings-type: cfp
125           global-settings: 'odl-global-settings'
126           global-settings-type: cfp
127
128     publishers:
129       - email-notification:
130           email-recipients: '{email-recipients}'
131           email-prefix: '{email-upstream}'
132       - findbugs
133       - jacoco-report
134       - opendaylight-infra-shiplogs:
135           maven-version: 'mvn33'
136
137 - job-template:
138     name: '{project-name}-merge-{stream}'
139
140     # Job template for ODL merge jobs
141     #
142     # The purpose of this job template is to setup a ODL merge job
143     # and deploy artifacts to Nexus.
144     #
145     # Required Variables:
146     #     stream:    release stream (eg. boron or carbon)
147     #     branch:    git branch (eg. stable/boron or master)
148
149     # Need to keep jobs that deploy to Nexus at end of build as Maven
150     # projects. Maybe reconsider this once upstream moves deploy to a
151     # separate lifecycle:
152     #     https://issues.apache.org/jira/browse/MNG-5666
153     project-type: maven
154     node: '{build-node}'
155     jdk: '{jdk}'
156
157     properties:
158       - opendaylight-infra-properties:
159           build-days-to-keep: 14
160
161     parameters:
162       - opendaylight-infra-parameters:
163           os-cloud: '{os-cloud}'
164           project: '{project}'
165           branch: '{branch}'
166           refspec: 'refs/heads/{branch}'
167           artifacts: '{archive-artifacts}'
168
169     scm:
170       - gerrit-trigger-scm:
171           refspec: ''
172           choosing-strategy: 'default'
173
174     wrappers:
175       - opendaylight-infra-wrappers:
176           build-timeout: '{build-timeout}'
177
178     triggers:
179       - timed: 'H H * * 0'
180       - gerrit-trigger-patch-merged:
181           server-name: '{server-name}'
182           name: '{project}'
183           branch: '{branch}'
184
185     prebuilders:
186       - jacoco-nojava-workaround
187       - provide-maven-settings:
188           global-settings-file: 'odl-global-settings'
189           settings-file: '{mvn-settings}'
190
191     # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
192     maven:
193       maven-name: 'mvn33'
194       goals: >
195           {mvn-goals}
196           -Dmerge
197           -Dstream={stream}
198           {opendaylight-infra-mvn-opts}
199       maven-opts: '{mvn-opts}'
200       settings: '{mvn-settings}'
201       settings-type: cfp
202       global-settings: 'odl-global-settings'
203       global-settings-type: cfp
204       post-step-run-condition: UNSTABLE
205
206     postbuilders:
207       - conditional-step:
208           condition-kind: file-exists
209           condition-filename: deploy-site.xml
210           condition-basedir: workspace
211
212           # The strategy here is intentional to run Maven site:deploy twice
213           # once using regular pom.xml to produce a staged-site which is
214           # then used by deploy-site.xml to push to Nexus. This is a
215           # workaround to Maven Site's default linking code which creates
216           # incorrect URLs for sites due to auto-detection assuming your
217           # project is configured in a certain way which ODL is not.
218           steps:
219             - maven-target:
220                 maven-version: 'mvn33'
221                 pom: pom.xml
222                 goals: 'site:deploy -V -B -Dstream={stream}'
223                 java-opts:
224                   - '-Xmx2g'
225                 settings: '{mvn-settings}'
226                 settings-type: cfp
227                 global-settings: 'odl-global-settings'
228                 global-settings-type: cfp
229             - maven-target:
230                 maven-version: 'mvn33'
231                 pom: deploy-site.xml
232                 goals: 'site:deploy -V -B -Dstream={stream}'
233                 java-opts:
234                   - '-Xmx2g'
235                 settings: '{mvn-settings}'
236                 settings-type: cfp
237                 global-settings: 'odl-global-settings'
238                 global-settings-type: cfp
239
240     reporters:
241       - findbugs
242
243     publishers:
244       - email-notification:
245           email-recipients: '{email-recipients}'
246           email-prefix: '[{project-name}]'
247       - maven-deploy:
248           id: ''
249           unique-version: true
250           deploy-unstable: false
251       - jacoco-report
252       - opendaylight-infra-shiplogs:
253           maven-version: 'mvn33'
254       - trigger:
255           project: 'distribution-merge-{stream}'
256           threshold: SUCCESS
257
258 - job-template:
259     name: '{project-name}-sonar'
260     disabled: false
261
262     project-type: freestyle
263     node: '{build-node}'
264     jdk: 'openjdk8'
265
266     properties:
267       - opendaylight-infra-properties:
268           build-days-to-keep: 7
269
270     parameters:
271       - opendaylight-infra-parameters:
272           os-cloud: '{os-cloud}'
273           project: '{project}'
274           branch: '{branch}'
275           refspec: 'refs/heads/{branch}'
276           artifacts: '{archive-artifacts}'
277
278     scm:
279       - git-scm:
280           refspec: ''
281           branch: 'master'
282
283     wrappers:
284       - opendaylight-infra-wrappers:
285           build-timeout: '{build-timeout}'
286
287     triggers:
288       - timed: 'H H * * 6'
289       - gerrit-trigger-patch-sonar:
290           server-name: '{server-name}'
291           name: '{project}'
292           # FIXME: Make sure this does not alter Gerrit votes, then update docs.
293
294     builders:
295       - jacoco-nojava-workaround
296       - provide-maven-settings:
297           global-settings-file: 'odl-global-settings'
298           settings-file: '{mvn-settings}'
299       - maven-target:
300           maven-version: 'mvn33'
301           goals: |
302               {mvn-goals}
303               -Dsonar
304               {opendaylight-infra-mvn-opts}
305           maven-opts:
306             - '{mvn-opts}'
307           settings: '{mvn-settings}'
308           settings-type: cfp
309           global-settings: 'odl-global-settings'
310           global-settings-type: cfp
311       - maven-target:
312           maven-version: 'mvn33'
313           # We should switch to the recommended configuration of sonar once
314           # JJB adds support for configurating the Sonar wrapper:
315           #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
316           goals: |
317               sonar:sonar
318               -Dsonar
319               -Dsonar.host.url=https://sonar.opendaylight.org
320               {opendaylight-infra-mvn-opts}
321           maven-opts:
322             - '{mvn-opts}'
323           settings: '{mvn-settings}'
324           settings-type: cfp
325           global-settings: 'odl-global-settings'
326           global-settings-type: cfp
327
328     publishers:
329       - email-notification:
330           email-recipients: '{email-recipients}'
331           email-prefix: '[{project-name}]'
332       - jacoco-report
333       - findbugs
334       - opendaylight-infra-shiplogs:
335           maven-version: 'mvn33'
336
337 - job-template:
338     name: '{project-name}-validate-autorelease-{stream}'
339     disabled: false
340
341     project-type: freestyle
342     node: '{build-node}'
343     concurrent: true
344     jdk: '{jdk}'
345
346     properties:
347       - opendaylight-infra-properties:
348           build-days-to-keep: 7
349
350     parameters:
351       - opendaylight-infra-parameters:
352           os-cloud: '{os-cloud}'
353           project: '{project}'
354           branch: '{branch}'
355           refspec: 'refs/heads/{branch}'
356           artifacts: '{archive-artifacts}'
357       - autorelease-release-tag:
358           release-tag: 'validate'
359       - autorelease-release-branch:
360           release-branch: '{branch}'
361       - string:
362           name: CLONE_URL
363           default: '{git-url}/releng/autorelease'
364           description: "Autorelease clone URL"
365
366     scm:
367       - git:
368           url: '$CLONE_URL'
369           credentials-id: 'opendaylight-jenkins-ssh'
370           refspec: ''
371           branches:
372             - 'origin/{branch}'
373           skip-tag: true
374           submodule:
375             recursive: true
376             timeout: 60
377
378     wrappers:
379       - opendaylight-infra-wrappers:
380           build-timeout: '{build-timeout}'
381
382     triggers:
383       - gerrit-trigger-patch-submitted:
384           server: '{server-name}'
385           project: '{project}'
386           branch: '{branch}'
387           files: '**/*.xml'
388
389     builders:
390       - jacoco-nojava-workaround
391       - autorelease-checkout-gerrit-patch
392       - autorelease-generate-release-patches
393       # In a perfect world projects should be releasing separately and we consume them
394       # via a project that pulls the release bits from each project from Nexus.
395       # Keep the patches compatible with that ideal, but apply an edit
396       # to enable building in a single maven reactor afterwards.
397       - autorelease-fix-relative-paths
398       - maven-target:
399           maven-version: 'mvn33'
400           pom: validate-pom.xml
401           goals: |
402               clean install dependency:tree
403               -T1.5C
404               -Pq
405               {opendaylight-infra-mvn-opts}
406           java-opts:
407             - '-Xmx8g'
408           settings: 'autorelease-settings'
409           settings-type: cfp
410           global-settings: 'odl-global-settings'
411           global-settings-type: cfp
412       - maven-target:
413           maven-version: 'mvn33'
414           pom: 'pom.xml'
415           goals: |
416               clean validate
417               -Pq
418               {opendaylight-infra-mvn-opts}
419           java-opts:
420             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
421           settings: 'autorelease-settings'
422           settings-type: cfp
423           global-settings: 'odl-global-settings'
424           global-settings-type: cfp
425
426     publishers:
427       - email-notification:
428           email-recipients: '{email-recipients}'
429           email-prefix: '[autorelease] [{project-name}]'
430       - opendaylight-infra-shiplogs:
431           maven-version: 'mvn33'
432
433 - job-template:
434     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
435
436     # Job template for ODL verify jobs
437     #
438     # The purpose of this job template is to setup a ODL verify job
439     #
440     # Required Variables:
441     #     stream:    release stream (eg. boron or carbon)
442     #     branch:    git branch (eg. stable/boron or master)
443
444     project-type: freestyle
445     node: '{build-node}'
446     concurrent: true
447     jdk: '{jdks}'
448
449     properties:
450       - opendaylight-infra-properties:
451           build-days-to-keep: 7
452
453     parameters:
454       - opendaylight-infra-parameters:
455           os-cloud: '{os-cloud}'
456           project: '{project}'
457           branch: '{branch}'
458           refspec: 'refs/heads/{branch}'
459           artifacts: '{archive-artifacts}'
460
461     scm:
462       - gerrit-trigger-scm:
463           refspec: '$GERRIT_REFSPEC'
464           choosing-strategy: 'gerrit'
465
466     wrappers:
467       - opendaylight-infra-wrappers:
468           build-timeout: '{build-timeout}'
469
470     triggers:
471       - gerrit-trigger-patch-submitted:
472           server: '{server-name}'
473           project: '{project}'
474           branch: '{branch}'
475           files: '**'
476
477     builders:
478       - jacoco-nojava-workaround
479       - provide-maven-settings:
480           global-settings-file: 'odl-global-settings'
481           settings-file: '{mvn-settings}'
482       - maven-target:
483           maven-version: '{mvn-version}'
484           goals: |
485               {mvn-goals}
486               -Dstream={stream}
487               {opendaylight-infra-mvn-opts}
488           java-opts:
489             - '{mvn-opts}'
490           settings: '{mvn-settings}'
491           settings-type: cfp
492           global-settings: 'odl-global-settings'
493           global-settings-type: cfp
494
495     publishers:
496       - findbugs
497       - email-notification:
498           email-recipients: '{email-recipients}'
499           email-prefix: '[{project-name}]'
500       - jacoco-report
501       - opendaylight-infra-shiplogs:
502           maven-version: '{mvn-version}'