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