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