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: 'false'
181                 - draft-published-event
182                 - comment-added-contains-event:
183                     comment-contains-value: 'test-distribution'
184                 - comment-added-contains-event:
185                     comment-contains-value: 'reverify'
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-prefix: '[{project-name}]'
226         - postbuildscript:
227             builders:
228                 - shell: |
229                     #!/bin/bash
230                     mkdir -p $WORKSPACE/archives
231                     cp karaf*.log $WORKSPACE/archives
232             script-only-if-succeeded: False
233             script-only-if-failed: False
234             mark-unstable-if-failed: True
235         - archive:
236             artifacts: '*.zip'
237         - opendaylight-infra-shiplogs:
238             maven-version: 'mvn33'
239
240 - job-template:
241     name: '{project-name}-integration-{stream}'
242
243     # Job template for ODL integration verify jobs
244     #
245     # This is similar to a normal verify job, but it runs
246     # when a project that's a dependency of your project
247     # is successfully built.
248     #
249     # Required Variables:
250     #     stream:    release stream (eg. boron or carbon)
251     #     branch:    git branch (eg. stable/boron or master)
252
253     project-type: freestyle
254     node: '{build-node}'
255     jdk: '{jdk}'
256
257     logrotate:
258         daysToKeep: '{build-days-to-keep}'
259         numToKeep: '{build-num-to-keep}'
260         artifactDaysToKeep: '{build-artifact-days-to-keep}'
261         artifactNumToKeep: '{build-artifact-num-to-keep}'
262
263     parameters:
264         - opendaylight-infra-parameters:
265             project: '{project}'
266             branch: '{branch}'
267             refspec: 'refs/heads/{branch}'
268             artifacts: '{archive-artifacts}'
269
270     scm:
271         - git-scm:
272             refspec: ''
273             branch: '{branch}'
274
275     wrappers:
276         - opendaylight-infra-wrappers:
277             build-timeout: '{build-timeout}'
278
279     triggers:
280         - reverse:
281             jobs: '{dependencies}'
282             result: 'success'
283
284     builders:
285         - jacoco-nojava-workaround
286         - provide-maven-settings:
287             global-settings-file: 'odl-global-settings'
288             settings-file: '{mvn-settings}'
289         - maven-target:
290             maven-version: 'mvn33'
291             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
292             java-opts:
293               - '{mvn-opts}'
294             settings: '{mvn-settings}'
295             settings-type: cfp
296             global-settings: 'odl-global-settings'
297             global-settings-type: cfp
298
299     publishers:
300         - email-notification:
301             email-prefix: '{email-upstream}'
302         - findbugs
303         - jacoco-report
304         - opendaylight-infra-shiplogs:
305             maven-version: 'mvn33'
306
307 - job-template:
308     name: '{project-name}-merge-{stream}'
309
310     # Job template for ODL merge jobs
311     #
312     # The purpose of this job template is to setup a ODL merge job
313     # and deploy artifacts to Nexus.
314     #
315     # Required Variables:
316     #     stream:    release stream (eg. boron or carbon)
317     #     branch:    git branch (eg. stable/boron or master)
318
319     # Need to keep jobs that deploy to Nexus at end of build as Maven
320     # projects. Maybe reconsider this once upstream moves deploy to a
321     # separate lifecycle:
322     #     https://issues.apache.org/jira/browse/MNG-5666
323     project-type: maven
324     node: '{build-node}'
325     jdk: '{jdk}'
326
327     logrotate:
328         daysToKeep: '14'
329         numToKeep: '10'
330         artifactDaysToKeep: '{build-artifact-days-to-keep}'
331         artifactNumToKeep: '{build-artifact-num-to-keep}'
332
333     parameters:
334         - opendaylight-infra-parameters:
335             project: '{project}'
336             branch: '{branch}'
337             refspec: 'refs/heads/{branch}'
338             artifacts: '{archive-artifacts}'
339
340     scm:
341         - gerrit-trigger-scm:
342             refspec: ''
343             choosing-strategy: 'default'
344
345     wrappers:
346         - opendaylight-infra-wrappers:
347             build-timeout: '{build-timeout}'
348
349     triggers:
350         - timed: 'H H * * 0'
351         - gerrit-trigger-patch-merged:
352             name: '{project}'
353             branch: '{branch}'
354
355     prebuilders:
356         - jacoco-nojava-workaround
357         - provide-maven-settings:
358             global-settings-file: 'odl-global-settings'
359             settings-file: '{mvn-settings}'
360
361     maven:
362         maven-name: 'mvn33'
363         goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
364         maven-opts: '{mvn-opts}'
365         settings: '{mvn-settings}'
366         settings-type: cfp
367         global-settings: 'odl-global-settings'
368         global-settings-type: cfp
369         post-step-run-condition: UNSTABLE
370
371     postbuilders:
372         - conditional-step:
373             condition-kind: file-exists
374             condition-filename: deploy-site.xml
375             condition-basedir: workspace
376
377             # The strategy here is intentional to run Maven site:deploy twice
378             # once using regular pom.xml to produce a staged-site which is
379             # then used by deploy-site.xml to push to Nexus. This is a
380             # workaround to Maven Site's default linking code which creates
381             # incorrect URLs for sites due to auto-detection assuming your
382             # project is configured in a certain way which ODL is not.
383             steps:
384             - maven-target:
385                 maven-version: 'mvn33'
386                 pom: pom.xml
387                 goals: 'site:deploy -V -B -Dstream={stream}'
388                 java-opts:
389                     - '-Xmx2g'
390                 settings: '{mvn-settings}'
391                 settings-type: cfp
392                 global-settings: 'odl-global-settings'
393                 global-settings-type: cfp
394             - maven-target:
395                 maven-version: 'mvn33'
396                 pom: deploy-site.xml
397                 goals: 'site:deploy -V -B -Dstream={stream}'
398                 java-opts:
399                     - '-Xmx2g'
400                 settings: '{mvn-settings}'
401                 settings-type: cfp
402                 global-settings: 'odl-global-settings'
403                 global-settings-type: cfp
404
405     reporters:
406         - findbugs
407
408     publishers:
409         - email-notification:
410             email-prefix: '[{project-name}]'
411         - maven-deploy:
412             id: ''
413             unique-version: true
414             deploy-unstable: false
415         - jacoco-report
416         - opendaylight-infra-shiplogs:
417             maven-version: 'mvn33'
418
419 - job-template:
420     name: '{project-name}-periodic-{stream}'
421
422     # Job template for periodic builders
423     #
424     # The purpose of this job template is to setup a periodic
425     # builder.
426     #
427     # Required Variables:
428     #     stream:    release stream (eg. boron or carbon)
429     #     branch:    git branch (eg. stable/boron or master)
430
431     project-type: freestyle
432     node: '{build-node}'
433     jdk: '{jdk}'
434
435     logrotate:
436         daysToKeep: '14'
437
438     parameters:
439         - opendaylight-infra-parameters:
440             project: '{project}'
441             branch: '{branch}'
442             refspec: 'refs/heads/{branch}'
443             artifacts: '{archive-artifacts}'
444
445     scm:
446         - git-scm:
447             refspec: ''
448             branch: '{branch}'
449
450     wrappers:
451         - opendaylight-infra-wrappers:
452             build-timeout: '{build-timeout}'
453
454     triggers:
455         - timed: '@daily'
456
457     builders:
458         - jacoco-nojava-workaround
459         - provide-maven-settings:
460             global-settings-file: 'odl-global-settings'
461             settings-file: '{mvn-settings}'
462         - maven-target:
463             maven-version: 'mvn33'
464             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
465             java-opts:
466               - '{mvn-opts}'
467             settings: '{mvn-settings}'
468             settings-type: cfp
469             global-settings: 'odl-global-settings'
470             global-settings-type: cfp
471
472     publishers:
473         - email-notification:
474             email-prefix: '[{project-name}]'
475         - jacoco-report
476         - findbugs
477         - opendaylight-infra-shiplogs:
478             maven-version: 'mvn33'
479
480 - job-template:
481     name: '{project-name}-sonar'
482     disabled: false
483
484     project-type: freestyle
485     node: '{build-node}'
486     jdk: 'openjdk8'
487
488     logrotate:
489         daysToKeep: '7'
490         numToKeep: '10'
491         artifactDaysToKeep: '1'
492         artifactNumToKeep: '1'
493
494     parameters:
495         - opendaylight-infra-parameters:
496             project: '{project}'
497             branch: '{branch}'
498             refspec: 'refs/heads/{branch}'
499             artifacts: '{archive-artifacts}'
500
501     scm:
502         - git-scm:
503             refspec: ''
504             branch: 'master'
505
506     wrappers:
507         - opendaylight-infra-wrappers:
508             build-timeout: '{build-timeout}'
509
510     triggers:
511         - timed: 'H H * * 6'
512         - gerrit-trigger-patch-sonar:
513             name: '{project}'
514
515     builders:
516         - jacoco-nojava-workaround
517         - provide-maven-settings:
518             global-settings-file: 'odl-global-settings'
519             settings-file: '{mvn-settings}'
520         - maven-target:
521             maven-version: 'mvn33'
522             goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
523             maven-opts:
524               - '{mvn-opts}'
525             settings: '{mvn-settings}'
526             settings-type: cfp
527             global-settings: 'odl-global-settings'
528             global-settings-type: cfp
529         - maven-target:
530             maven-version: 'mvn33'
531             # We should switch to the recommended configuration of sonar once
532             # JJB adds support for configurating the Sonar wrapper:
533             #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
534             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'
535             maven-opts:
536               - '{mvn-opts}'
537             settings: '{mvn-settings}'
538             settings-type: cfp
539             global-settings: 'odl-global-settings'
540             global-settings-type: cfp
541
542     publishers:
543         - email-notification:
544             email-prefix: '[{project-name}]'
545         - jacoco-report
546         - findbugs
547         - opendaylight-infra-shiplogs:
548             maven-version: 'mvn33'
549
550 - job-template:
551     name: '{project-name}-validate-autorelease-{stream}'
552     disabled: '{obj:disable_autorelease}'
553
554     project-type: freestyle
555     node: '{build-node}'
556     concurrent: true
557     jdk: '{jdk}'
558
559     logrotate:
560         daysToKeep: '7'
561
562     parameters:
563         - opendaylight-infra-parameters:
564             project: '{project}'
565             branch: '{branch}'
566             refspec: 'refs/heads/{branch}'
567             artifacts: '{archive-artifacts}'
568         - autorelease-release-tag:
569             release-tag: 'validate'
570         - autorelease-release-branch:
571             release-branch: '{branch}'
572         - string:
573             name: CLONE_URL
574             default: 'ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/autorelease'
575             description: "Autorelease clone URL"
576
577     scm:
578         - git:
579             url: '$CLONE_URL'
580             credentials-id: 'opendaylight-jenkins-ssh'
581             refspec: ''
582             branches:
583                 - 'origin/{branch}'
584             skip-tag: true
585             submodule:
586                 recursive: true
587                 timeout: 60
588
589     wrappers:
590         - opendaylight-infra-wrappers:
591             build-timeout: '{build-timeout}'
592
593     triggers:
594         - gerrit:
595             server-name: 'OpenDaylight'
596             trigger-on:
597                 - patchset-created-event:
598                     exclude-drafts: 'true'
599                     exclude-trivial-rebase: 'false'
600                     exclude-no-code-change: 'true'
601                 - draft-published-event
602                 - comment-added-contains-event:
603                     comment-contains-value: 'recheck'
604                 - comment-added-contains-event:
605                     comment-contains-value: 'reverify'
606                 - comment-added-contains-event:
607                     comment-contains-value: 'revalidate'
608             projects:
609               - project-compare-type: 'ANT'
610                 project-pattern: '{project}'
611                 branches:
612                   - branch-compare-type: 'ANT'
613                     branch-pattern: '**/{branch}'
614                 file-paths:
615                     - compare-type: ANT
616                       pattern: '**/*.xml'
617
618     builders:
619         - jacoco-nojava-workaround
620         - autorelease-checkout-gerrit-patch
621         - autorelease-generate-release-patches
622         - maven-target:
623             maven-version: 'mvn33'
624             pom: validate-pom.xml
625             goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
626             java-opts:
627               - '-Xmx8g'
628             settings: 'autorelease-settings'
629             settings-type: cfp
630             global-settings: 'odl-global-settings'
631             global-settings-type: cfp
632         - maven-target:
633             maven-version: 'mvn33'
634             pom: 'pom.xml'
635             goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
636             java-opts:
637               - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
638             settings: 'autorelease-settings'
639             settings-type: cfp
640             global-settings: 'odl-global-settings'
641             global-settings-type: cfp
642         - autorelease-sys-stats
643
644     publishers:
645         - email-notification:
646             email-prefix: '[autorelease] [{project-name}]'
647         - opendaylight-infra-shiplogs:
648             maven-version: 'mvn33'
649
650 - job-template:
651     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
652
653     # Job template for ODL verify jobs
654     #
655     # The purpose of this job template is to setup a ODL verify job
656     #
657     # Required Variables:
658     #     stream:    release stream (eg. boron or carbon)
659     #     branch:    git branch (eg. stable/boron or master)
660
661     project-type: freestyle
662     node: '{build-node}'
663     concurrent: true
664     jdk: '{jdks}'
665
666     logrotate:
667         daysToKeep: '7'
668
669     parameters:
670         - opendaylight-infra-parameters:
671             project: '{project}'
672             branch: '{branch}'
673             refspec: 'refs/heads/{branch}'
674             artifacts: '{archive-artifacts}'
675
676     scm:
677         - gerrit-trigger-scm:
678             refspec: '$GERRIT_REFSPEC'
679             choosing-strategy: 'gerrit'
680
681     wrappers:
682         - opendaylight-infra-wrappers:
683             build-timeout: '{build-timeout}'
684
685     triggers:
686         - gerrit-trigger-patch-submitted:
687             name: '{project}'
688             branch: '{branch}'
689
690     builders:
691         - jacoco-nojava-workaround
692         - provide-maven-settings:
693             global-settings-file: 'odl-global-settings'
694             settings-file: '{mvn-settings}'
695         - maven-target:
696             maven-version: '{mvn-version}'
697             goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
698             java-opts:
699                 - '{mvn-opts}'
700             settings: '{mvn-settings}'
701             settings-type: cfp
702             global-settings: 'odl-global-settings'
703             global-settings-type: cfp
704
705     publishers:
706         - findbugs
707         - email-notification:
708             email-prefix: '[{project-name}]'
709         - jacoco-report
710         - opendaylight-infra-shiplogs:
711             maven-version: '{mvn-version}'