Merge "Modify get bundle script to deal with distribution-check artifacts"
[releng/builder.git] / jjb / releng-templates-java.yaml
1 - job-template:
2     # Template used for running CLM scans
3     # Arguements:
4     #   {name}         - Project Shortname
5     #   {project}      - Fully qualified project name
6     #   {mvn-settings} - Project maven settings file
7     #   {stream}
8     #   {jdk}
9     name: '{project-name}-clm-{stream}'
10
11     project-type: freestyle
12     node: '{build-node}'
13     jdk: '{jdk}'
14
15     logrotate:
16         daysToKeep: '{build-days-to-keep}'
17         numToKeep: '{build-num-to-keep}'
18
19     parameters:
20         - opendaylight-infra-parameters:
21             project: '{project}'
22             branch: '{branch}'
23             refspec: 'refs/heads/{branch}'
24             artifacts: '{archive-artifacts}'
25
26     scm:
27         - git-scm:
28             refspec: ''
29             branch: '{branch}'
30
31     wrappers:
32         - opendaylight-infra-wrappers:
33             build-timeout: '{build-timeout}'
34
35     triggers:
36         - timed: 'H H * * 6'
37
38     builders:
39         - provide-maven-settings:
40             global-settings-file: 'odl-global-settings'
41             settings-file: '{mvn-settings}'
42         - maven-target:
43             maven-version: '{mvn33}'
44             pom: 'pom.xml'
45             goals: 'clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
46             java-opts:
47               - '-Xmx4096m -XX:MaxPermSize=512m'
48             settings: '{mvn-settings}'
49             settings-type: cfp
50             global-settings: 'odl-global-settings'
51             global-settings-type: cfp
52         - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
53         - check-clm:
54             application-name: '{project-name}'
55
56     publishers:
57         - email-notification:
58             email-prefix: '[{project-name}]'
59         - opendaylight-infra-shiplogs:
60             maven-version: '{mvn33}'
61
62 - job-template:
63     name: '{project-name}-distribution-{stream}'
64
65     # Required variables:
66     #     stream:    release stream (eg. stable-lithium or beryllium)
67     #     branch:    git branch (eg. stable/lithium or master)
68
69     project-type: maven
70     node: '{build-node}'
71     jdk: '{jdk}'
72
73     logrotate:
74         daysToKeep: '{build-days-to-keep}'
75         numToKeep: '{build-num-to-keep}'
76         artifactDaysToKeep: '{build-artifact-days-to-keep}'
77         artifactNumToKeep: '{build-artifact-num-to-keep}'
78
79     parameters:
80         - opendaylight-infra-parameters:
81             project: 'integration/distribution'
82             branch: '{branch}'
83             refspec: 'refs/heads/{branch}'
84             artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
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: '{project}-merge-{stream}'
98             result: 'success'
99
100     prebuilders:
101         - provide-maven-settings:
102             global-settings-file: 'odl-global-settings'
103             settings-file: '{mvn-settings}'
104
105     maven:
106         maven-name: '{mvn33}'
107         root-pom: 'pom.xml'
108         goals: 'clean install dependency:tree -DoutputFile=dependency_tree.txt -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
109         maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
110         settings: 'integration-distribution-settings'
111         settings-type: cfp
112         global-settings: 'odl-global-settings'
113         global-settings-type: cfp
114
115     publishers:
116         - email-notification:
117             email-prefix: '[{project}]'
118         - maven-deploy:
119             id: ''
120             unique-version: true
121             deploy-unstable: false
122         - opendaylight-infra-shiplogs:
123             maven-version: '{mvn33}'
124
125 - job-template:
126     # Template: {name}-distribution-check-{stream}
127     # Goal: Build a patch and make sure the distribution can deploy with this change
128     # Operation: This job template builds a patch, creates a distribution containing
129     #            the patch, and triggers the distribution deploy test
130
131     name: '{project-name}-distribution-check-{stream}'
132     disabled: '{obj:disable_distribution_check}'
133
134     project-type: freestyle
135     node: '{build-node}'
136     concurrent: true
137     jdk: '{jdk}'
138
139     logrotate:
140         daysToKeep: '{build-days-to-keep}'
141         numToKeep: '{build-num-to-keep}'
142         artifactDaysToKeep: '{build-artifact-days-to-keep}'
143         artifactNumToKeep: '{build-artifact-num-to-keep}'
144
145     parameters:
146         - opendaylight-infra-parameters:
147             project: '{project}'
148             branch: '{branch}'
149             refspec: 'refs/heads/{branch}'
150             artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
151         - integration-distribution-git-url
152
153     scm:
154         - integration-gerrit-scm:
155             basedir: '$GERRIT_PROJECT'
156             refspec: '$GERRIT_REFSPEC'
157             branch: '{branch}'
158         - integration-distribution-scm:
159             branch: '{branch}'
160
161     wrappers:
162         - opendaylight-infra-wrappers:
163             build-timeout: '{build-timeout}'
164
165     triggers:
166         - gerrit:
167             server-name: 'OpenDaylight'
168             trigger-on:
169                 - patchset-created-event:
170                     exclude-drafts: 'true'
171                     exclude-trivial-rebase: 'false'
172                     exclude-no-code-change: 'true'
173                 - draft-published-event
174                 - comment-added-contains-event:
175                     comment-contains-value: 'test-distribution'
176                 - comment-added-contains-event:
177                     comment-contains-value: 'reverify'
178                 - comment-added-contains-event:
179                     comment-contains-value: 'recheck'
180             projects:
181               - project-compare-type: 'ANT'
182                 project-pattern: '{project}'
183                 branches:
184                   - branch-compare-type: 'ANT'
185                     branch-pattern: '**/{branch}'
186             skip-vote:
187                 successful: false
188                 failed: false
189                 unstable: false
190                 notbuilt: false
191
192     builders:
193         - maven-target:
194             maven-version: '{mvn33}'
195             pom: '$GERRIT_PROJECT/pom.xml'
196             goals: 'clean install dependency:tree -DoutputFile=dependency_tree.txt -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r -Dstream={stream}'
197             java-opts:
198                 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
199             settings: '{mvn-settings}'
200             settings-type: cfp
201             global-settings: 'odl-global-settings'
202             global-settings-type: cfp
203         - maven-target:
204             maven-version: '{mvn33}'
205             pom: 'distribution/pom.xml'
206             goals: 'clean install dependency:tree -DoutputFile=dependency_tree.txt -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
207             java-opts:
208               - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
209             settings: '{mvn-settings}'
210             settings-type: cfp
211             global-settings: 'odl-global-settings'
212             global-settings-type: cfp
213         - integration-distribution-check
214
215     publishers:
216         - email-notification:
217             email-prefix: '[{project-name}]'
218         - postbuildscript:
219             builders:
220                 - shell: |
221                     #!/bin/bash
222                     mkdir -p $WORKSPACE/archives
223                     cp karaf*.log $WORKSPACE/archives
224             script-only-if-succeeded: False
225             script-only-if-failed: False
226             mark-unstable-if-failed: True
227         - archive:
228             artifacts: '*.zip'
229         - opendaylight-infra-shiplogs:
230             maven-version: '{mvn33}'
231
232 - job-template:
233     name: '{project-name}-integration-{stream}'
234
235     # Job template for ODL integration verify jobs
236     #
237     # This is similar to a normal verify job, but it runs
238     # when a project that's a dependency of your project
239     # is successfully built.
240     #
241     # Required Variables:
242     #     stream:    release stream (eg. stable-lithium or beryllium)
243     #     branch:    git branch (eg. stable/lithium or master)
244
245     project-type: freestyle
246     node: '{build-node}'
247     jdk: '{jdk}'
248
249     logrotate:
250         daysToKeep: '{build-days-to-keep}'
251         numToKeep: '{build-num-to-keep}'
252         artifactDaysToKeep: '{build-artifact-days-to-keep}'
253         artifactNumToKeep: '{build-artifact-num-to-keep}'
254
255     parameters:
256         - opendaylight-infra-parameters:
257             project: '{project}'
258             branch: '{branch}'
259             refspec: 'refs/heads/{branch}'
260             artifacts: '{archive-artifacts}'
261
262     scm:
263         - git-scm:
264             refspec: ''
265             branch: '{branch}'
266
267     wrappers:
268         - opendaylight-infra-wrappers:
269             build-timeout: '{build-timeout}'
270
271     triggers:
272         - reverse:
273             jobs: '{dependencies}'
274             result: 'success'
275
276     builders:
277         - jacoco-nojava-workaround
278         - provide-maven-settings:
279             global-settings-file: 'odl-global-settings'
280             settings-file: '{mvn-settings}'
281         - maven-target:
282             maven-version: '{mvn33}'
283             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
284             java-opts:
285               - '{mvn-opts}'
286             settings: '{mvn-settings}'
287             settings-type: cfp
288             global-settings: 'odl-global-settings'
289             global-settings-type: cfp
290
291     publishers:
292         - email-notification:
293             email-prefix: '{email-upstream}'
294         - findbugs
295         - jacoco-report
296         - opendaylight-infra-shiplogs:
297             maven-version: '{mvn33}'
298
299 - job-template:
300     name: '{project-name}-merge-{stream}'
301
302     # Job template for ODL merge jobs
303     #
304     # The purpose of this job template is to setup a ODL merge job
305     # and deploy artifacts to Nexus.
306     #
307     # Required Variables:
308     #     stream:    release stream (eg. stable-lithium or beryllium)
309     #     branch:    git branch (eg. stable/lithium or master)
310
311     project-type: maven
312     node: '{build-node}'
313     jdk: '{jdk}'
314
315     logrotate:
316         daysToKeep: '14'
317         numToKeep: '10'
318         artifactDaysToKeep: '{build-artifact-days-to-keep}'
319         artifactNumToKeep: '{build-artifact-num-to-keep}'
320
321     parameters:
322         - opendaylight-infra-parameters:
323             project: '{project}'
324             branch: '{branch}'
325             refspec: 'refs/heads/{branch}'
326             artifacts: '{archive-artifacts}'
327
328     scm:
329         - gerrit-trigger-scm:
330             refspec: ''
331             choosing-strategy: 'default'
332
333     wrappers:
334         - opendaylight-infra-wrappers:
335             build-timeout: '{build-timeout}'
336
337     triggers:
338         - timed: 'H H * * 0'
339         - gerrit-trigger-patch-merged:
340             name: '{project}'
341             branch: '{branch}'
342
343     prebuilders:
344         - jacoco-nojava-workaround
345         - provide-maven-settings:
346             global-settings-file: 'odl-global-settings'
347             settings-file: '{mvn-settings}'
348
349     maven:
350         maven-name: '{mvn33}'
351         goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
352         maven-opts: '{mvn-opts}'
353         settings: '{mvn-settings}'
354         settings-type: cfp
355         global-settings: 'odl-global-settings'
356         global-settings-type: cfp
357         post-step-run-condition: UNSTABLE
358
359     postbuilders:
360         - conditional-step:
361             condition-kind: file-exists
362             condition-filename: deploy-site.xml
363             condition-basedir: workspace
364
365             # The strategy here is intentional to run Maven site:deploy twice
366             # once using regular pom.xml to produce a staged-site which is
367             # then used by deploy-site.xml to push to Nexus. This is a
368             # workaround to Maven Site's default linking code which creates
369             # incorrect URLs for sites due to auto-detection assuming your
370             # project is configured in a certain way which ODL is not.
371             steps:
372             - maven-target:
373                 maven-version: '{mvn33}'
374                 pom: pom.xml
375                 goals: 'site:deploy -V -B -Dstream={stream}'
376                 java-opts:
377                     - '-Xmx2g'
378                 settings: '{mvn-settings}'
379                 settings-type: cfp
380                 global-settings: 'odl-global-settings'
381                 global-settings-type: cfp
382             - maven-target:
383                 maven-version: '{mvn33}'
384                 pom: deploy-site.xml
385                 goals: 'site:deploy -V -B -Dstream={stream}'
386                 java-opts:
387                     - '-Xmx2g'
388                 settings: '{mvn-settings}'
389                 settings-type: cfp
390                 global-settings: 'odl-global-settings'
391                 global-settings-type: cfp
392
393     reporters:
394         - findbugs
395
396     publishers:
397         - email-notification:
398             email-prefix: '[{project-name}]'
399         - maven-deploy:
400             id: ''
401             unique-version: true
402             deploy-unstable: false
403         - jacoco-report
404         - opendaylight-infra-shiplogs:
405             maven-version: '{mvn33}'
406
407 - job-template:
408     name: '{project-name}-periodic-{stream}'
409
410     # Job template for periodic builders
411     #
412     # The purpose of this job template is to setup a periodic
413     # builder.
414     #
415     # Required Variables:
416     #     stream:    release stream (eg. stable-lithium or beryllium)
417     #     branch:    git branch (eg. stable/lithium or master)
418
419     project-type: freestyle
420     node: '{build-node}'
421     jdk: '{jdk}'
422
423     logrotate:
424         daysToKeep: '14'
425
426     parameters:
427         - opendaylight-infra-parameters:
428             project: '{project}'
429             branch: '{branch}'
430             refspec: 'refs/heads/{branch}'
431             artifacts: '{archive-artifacts}'
432
433     scm:
434         - git-scm:
435             refspec: ''
436             branch: '{branch}'
437
438     wrappers:
439         - opendaylight-infra-wrappers:
440             build-timeout: '{build-timeout}'
441
442     triggers:
443         - timed: '@daily'
444
445     builders:
446         - jacoco-nojava-workaround
447         - provide-maven-settings:
448             global-settings-file: 'odl-global-settings'
449             settings-file: '{mvn-settings}'
450         - maven-target:
451             maven-version: '{mvn33}'
452             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
453             java-opts:
454               - '{mvn-opts}'
455             settings: '{mvn-settings}'
456             settings-type: cfp
457             global-settings: 'odl-global-settings'
458             global-settings-type: cfp
459
460     publishers:
461         - email-notification:
462             email-prefix: '[{project-name}]'
463         - jacoco-report
464         - findbugs
465         - opendaylight-infra-shiplogs:
466             maven-version: '{mvn33}'
467
468 - job-template:
469     name: '{project-name}-sonar'
470     disabled: false
471
472     project-type: maven
473     node: '{build-node}'
474     jdk: 'openjdk8'
475
476     logrotate:
477         daysToKeep: '7'
478         numToKeep: '10'
479         artifactDaysToKeep: '1'
480         artifactNumToKeep: '1'
481
482     parameters:
483         - opendaylight-infra-parameters:
484             project: '{project}'
485             branch: '{branch}'
486             refspec: 'refs/heads/{branch}'
487             artifacts: '{archive-artifacts}'
488
489     scm:
490         - git-scm:
491             refspec: ''
492             branch: 'master'
493
494     wrappers:
495         - opendaylight-infra-wrappers:
496             build-timeout: '{build-timeout}'
497
498     triggers:
499         - timed: 'H H * * 6'
500         - gerrit-trigger-patch-sonar:
501             name: '{project}'
502
503     prebuilders:
504         - jacoco-nojava-workaround
505         - provide-maven-settings:
506             global-settings-file: 'odl-global-settings'
507             settings-file: '{mvn-settings}'
508
509     maven:
510         maven-name: '{mvn33}'
511         goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
512         maven-opts: '{mvn-opts}'
513         settings: '{mvn-settings}'
514         settings-type: cfp
515         global-settings: 'odl-global-settings'
516         global-settings-type: cfp
517
518     reporters:
519         - findbugs
520
521     publishers:
522         - sonar:
523             language: 'java'
524             maven-opts: '-Xmx6144m -XX:MaxPermSize=1024m'
525         - email-notification:
526             email-prefix: '[{project-name}]'
527         - jacoco-report
528         - opendaylight-infra-shiplogs:
529             maven-version: '{mvn33}'
530
531 - job-template:
532     name: '{project-name}-validate-autorelease-{stream}'
533     disabled: '{obj:disable_autorelease}'
534
535     project-type: freestyle
536     node: '{build-node}'
537     concurrent: true
538     jdk: '{jdk}'
539
540     logrotate:
541         daysToKeep: '7'
542
543     parameters:
544         - opendaylight-infra-parameters:
545             project: '{project}'
546             branch: '{branch}'
547             refspec: 'refs/heads/{branch}'
548             artifacts: '{archive-artifacts}'
549         - autorelease-release-tag:
550             release-tag: 'validate'
551         - autorelease-release-branch:
552             release-branch: '{branch}'
553         - string:
554             name: CLONE_URL
555             default: 'ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/autorelease'
556             description: "Autorelease clone URL"
557
558     scm:
559         - git:
560             url: '$CLONE_URL'
561             credentials-id: 'opendaylight-jenkins-ssh'
562             refspec: ''
563             branches:
564                 - 'origin/{branch}'
565             skip-tag: true
566             submodule:
567                 recursive: true
568                 timeout: 60
569
570     wrappers:
571         - opendaylight-infra-wrappers:
572             build-timeout: '{build-timeout}'
573
574     triggers:
575         - gerrit:
576             server-name: 'OpenDaylight'
577             trigger-on:
578                 - patchset-created-event:
579                     exclude-drafts: 'true'
580                     exclude-trivial-rebase: 'false'
581                     exclude-no-code-change: 'true'
582                 - draft-published-event
583                 - comment-added-contains-event:
584                     comment-contains-value: 'recheck'
585                 - comment-added-contains-event:
586                     comment-contains-value: 'reverify'
587                 - comment-added-contains-event:
588                     comment-contains-value: 'revalidate'
589             projects:
590               - project-compare-type: 'ANT'
591                 project-pattern: '{project}'
592                 branches:
593                   - branch-compare-type: 'ANT'
594                     branch-pattern: '**/{branch}'
595                 file-paths:
596                     - compare-type: ANT
597                       pattern: '**/*.xml'
598
599     builders:
600         - jacoco-nojava-workaround
601         - autorelease-checkout-gerrit-patch
602         - autorelease-generate-release-patches
603         - maven-target:
604             maven-version: '{mvn33}'
605             pom: validate-pom.xml
606             goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
607             java-opts:
608               - '-Xmx8g'
609             settings: 'autorelease-settings'
610             settings-type: cfp
611             global-settings: 'odl-global-settings'
612             global-settings-type: cfp
613         - maven-target:
614             maven-version: '{mvn33}'
615             pom: 'pom.xml'
616             goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
617             java-opts:
618               - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
619             settings: 'autorelease-settings'
620             settings-type: cfp
621             global-settings: 'odl-global-settings'
622             global-settings-type: cfp
623         - autorelease-sys-stats
624
625     publishers:
626         - email-notification:
627             email-prefix: '[autorelease] [{project-name}]'
628         - opendaylight-infra-shiplogs:
629             maven-version: '{mvn33}'
630
631 - job-template:
632     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
633
634     # Job template for ODL verify jobs
635     #
636     # The purpose of this job template is to setup a ODL verify job
637     #
638     # Required Variables:
639     #     stream:    release stream (eg. stable-lithium or beryllium)
640     #     branch:    git branch (eg. stable/lithium or master)
641
642     project-type: freestyle
643     node: '{build-node}'
644     concurrent: true
645     jdk: '{jdks}'
646
647     logrotate:
648         daysToKeep: '7'
649
650     parameters:
651         - opendaylight-infra-parameters:
652             project: '{project}'
653             branch: '{branch}'
654             refspec: 'refs/heads/{branch}'
655             artifacts: '{archive-artifacts}'
656
657     scm:
658         - gerrit-trigger-scm:
659             refspec: '$GERRIT_REFSPEC'
660             choosing-strategy: 'gerrit'
661
662     wrappers:
663         - opendaylight-infra-wrappers:
664             build-timeout: '{build-timeout}'
665
666     triggers:
667         - gerrit-trigger-patch-submitted:
668             name: '{project}'
669             branch: '{branch}'
670
671     builders:
672         - jacoco-nojava-workaround
673         - provide-maven-settings:
674             global-settings-file: 'odl-global-settings'
675             settings-file: '{mvn-settings}'
676         - maven-target:
677             maven-version: '{mvn-version}'
678             goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
679             java-opts:
680                 - '{mvn-opts}'
681             settings: '{mvn-settings}'
682             settings-type: cfp
683             global-settings: 'odl-global-settings'
684             global-settings-type: cfp
685
686     publishers:
687         - findbugs
688         - email-notification:
689             email-prefix: '[{project-name}]'
690         - jacoco-report
691         - opendaylight-infra-shiplogs:
692             maven-version: '{mvn-version}'