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