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