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