Merge "Add to install-feature:unimgr-netvirt to unimgr-cist-basic"
[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: false
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: '{server-name}'
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             server-name: '{server-name}'
355             name: '{project}'
356             branch: '{branch}'
357
358     prebuilders:
359         - jacoco-nojava-workaround
360         - provide-maven-settings:
361             global-settings-file: 'odl-global-settings'
362             settings-file: '{mvn-settings}'
363
364     maven:
365         maven-name: 'mvn33'
366         goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
367         maven-opts: '{mvn-opts}'
368         settings: '{mvn-settings}'
369         settings-type: cfp
370         global-settings: 'odl-global-settings'
371         global-settings-type: cfp
372         post-step-run-condition: UNSTABLE
373
374     postbuilders:
375         - conditional-step:
376             condition-kind: file-exists
377             condition-filename: deploy-site.xml
378             condition-basedir: workspace
379
380             # The strategy here is intentional to run Maven site:deploy twice
381             # once using regular pom.xml to produce a staged-site which is
382             # then used by deploy-site.xml to push to Nexus. This is a
383             # workaround to Maven Site's default linking code which creates
384             # incorrect URLs for sites due to auto-detection assuming your
385             # project is configured in a certain way which ODL is not.
386             steps:
387             - maven-target:
388                 maven-version: 'mvn33'
389                 pom: pom.xml
390                 goals: 'site:deploy -V -B -Dstream={stream}'
391                 java-opts:
392                     - '-Xmx2g'
393                 settings: '{mvn-settings}'
394                 settings-type: cfp
395                 global-settings: 'odl-global-settings'
396                 global-settings-type: cfp
397             - maven-target:
398                 maven-version: 'mvn33'
399                 pom: deploy-site.xml
400                 goals: 'site:deploy -V -B -Dstream={stream}'
401                 java-opts:
402                     - '-Xmx2g'
403                 settings: '{mvn-settings}'
404                 settings-type: cfp
405                 global-settings: 'odl-global-settings'
406                 global-settings-type: cfp
407
408     reporters:
409         - findbugs
410
411     publishers:
412         - email-notification:
413             email-recipients: '{email-recipients}'
414             email-prefix: '[{project-name}]'
415         - maven-deploy:
416             id: ''
417             unique-version: true
418             deploy-unstable: false
419         - jacoco-report
420         - opendaylight-infra-shiplogs:
421             maven-version: 'mvn33'
422
423 - job-template:
424     name: '{project-name}-periodic-{stream}'
425
426     # Job template for periodic builders
427     #
428     # The purpose of this job template is to setup a periodic
429     # builder.
430     #
431     # Required Variables:
432     #     stream:    release stream (eg. boron or carbon)
433     #     branch:    git branch (eg. stable/boron or master)
434
435     project-type: freestyle
436     node: '{build-node}'
437     jdk: '{jdk}'
438
439     logrotate:
440         daysToKeep: '14'
441
442     parameters:
443         - opendaylight-infra-parameters:
444             project: '{project}'
445             branch: '{branch}'
446             refspec: 'refs/heads/{branch}'
447             artifacts: '{archive-artifacts}'
448
449     scm:
450         - git-scm:
451             refspec: ''
452             branch: '{branch}'
453
454     wrappers:
455         - opendaylight-infra-wrappers:
456             build-timeout: '{build-timeout}'
457
458     triggers:
459         - timed: '@daily'
460
461     builders:
462         - jacoco-nojava-workaround
463         - provide-maven-settings:
464             global-settings-file: 'odl-global-settings'
465             settings-file: '{mvn-settings}'
466         - maven-target:
467             maven-version: 'mvn33'
468             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
469             java-opts:
470               - '{mvn-opts}'
471             settings: '{mvn-settings}'
472             settings-type: cfp
473             global-settings: 'odl-global-settings'
474             global-settings-type: cfp
475
476     publishers:
477         - email-notification:
478             email-recipients: '{email-recipients}'
479             email-prefix: '[{project-name}]'
480         - jacoco-report
481         - findbugs
482         - opendaylight-infra-shiplogs:
483             maven-version: 'mvn33'
484
485 - job-template:
486     name: '{project-name}-sonar'
487     disabled: false
488
489     project-type: freestyle
490     node: '{build-node}'
491     jdk: 'openjdk8'
492
493     logrotate:
494         daysToKeep: '7'
495         numToKeep: '10'
496         artifactDaysToKeep: '1'
497         artifactNumToKeep: '1'
498
499     parameters:
500         - opendaylight-infra-parameters:
501             project: '{project}'
502             branch: '{branch}'
503             refspec: 'refs/heads/{branch}'
504             artifacts: '{archive-artifacts}'
505
506     scm:
507         - git-scm:
508             refspec: ''
509             branch: 'master'
510
511     wrappers:
512         - opendaylight-infra-wrappers:
513             build-timeout: '{build-timeout}'
514
515     triggers:
516         - timed: 'H H * * 6'
517         - gerrit-trigger-patch-sonar:
518             server-name: '{server-name}'
519             name: '{project}'
520
521     builders:
522         - jacoco-nojava-workaround
523         - provide-maven-settings:
524             global-settings-file: 'odl-global-settings'
525             settings-file: '{mvn-settings}'
526         - maven-target:
527             maven-version: 'mvn33'
528             goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
529             maven-opts:
530               - '{mvn-opts}'
531             settings: '{mvn-settings}'
532             settings-type: cfp
533             global-settings: 'odl-global-settings'
534             global-settings-type: cfp
535         - maven-target:
536             maven-version: 'mvn33'
537             # We should switch to the recommended configuration of sonar once
538             # JJB adds support for configurating the Sonar wrapper:
539             #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
540             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'
541             maven-opts:
542               - '{mvn-opts}'
543             settings: '{mvn-settings}'
544             settings-type: cfp
545             global-settings: 'odl-global-settings'
546             global-settings-type: cfp
547
548     publishers:
549         - email-notification:
550             email-recipients: '{email-recipients}'
551             email-prefix: '[{project-name}]'
552         - jacoco-report
553         - findbugs
554         - opendaylight-infra-shiplogs:
555             maven-version: 'mvn33'
556
557 - job-template:
558     name: '{project-name}-validate-autorelease-{stream}'
559     disabled: false
560
561     project-type: freestyle
562     node: '{build-node}'
563     concurrent: true
564     jdk: '{jdk}'
565
566     logrotate:
567         daysToKeep: '7'
568
569     parameters:
570         - opendaylight-infra-parameters:
571             project: '{project}'
572             branch: '{branch}'
573             refspec: 'refs/heads/{branch}'
574             artifacts: '{archive-artifacts}'
575         - autorelease-release-tag:
576             release-tag: 'validate'
577         - autorelease-release-branch:
578             release-branch: '{branch}'
579         - string:
580             name: CLONE_URL
581             default: 'ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/autorelease'
582             description: "Autorelease clone URL"
583
584     scm:
585         - git:
586             url: '$CLONE_URL'
587             credentials-id: 'opendaylight-jenkins-ssh'
588             refspec: ''
589             branches:
590                 - 'origin/{branch}'
591             skip-tag: true
592             submodule:
593                 recursive: true
594                 timeout: 60
595
596     wrappers:
597         - opendaylight-infra-wrappers:
598             build-timeout: '{build-timeout}'
599
600     triggers:
601         - gerrit:
602             server-name: '{server-name}'
603             trigger-on:
604                 - patchset-created-event:
605                     exclude-drafts: 'true'
606                     exclude-trivial-rebase: 'false'
607                     exclude-no-code-change: 'true'
608                 - draft-published-event
609                 - comment-added-contains-event:
610                     comment-contains-value: 'recheck'
611                 - comment-added-contains-event:
612                     comment-contains-value: 'revalidate'
613             projects:
614               - project-compare-type: 'ANT'
615                 project-pattern: '{project}'
616                 branches:
617                   - branch-compare-type: 'ANT'
618                     branch-pattern: '**/{branch}'
619                 file-paths:
620                     - compare-type: ANT
621                       pattern: '**/*.xml'
622
623     builders:
624         - jacoco-nojava-workaround
625         - autorelease-checkout-gerrit-patch
626         - autorelease-generate-release-patches
627         - maven-target:
628             maven-version: 'mvn33'
629             pom: validate-pom.xml
630             goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
631             java-opts:
632               - '-Xmx8g'
633             settings: 'autorelease-settings'
634             settings-type: cfp
635             global-settings: 'odl-global-settings'
636             global-settings-type: cfp
637         - maven-target:
638             maven-version: 'mvn33'
639             pom: 'pom.xml'
640             goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
641             java-opts:
642               - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
643             settings: 'autorelease-settings'
644             settings-type: cfp
645             global-settings: 'odl-global-settings'
646             global-settings-type: cfp
647         - autorelease-sys-stats
648
649     publishers:
650         - email-notification:
651             email-recipients: '{email-recipients}'
652             email-prefix: '[autorelease] [{project-name}]'
653         - opendaylight-infra-shiplogs:
654             maven-version: 'mvn33'
655
656 - job-template:
657     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
658
659     # Job template for ODL verify jobs
660     #
661     # The purpose of this job template is to setup a ODL verify job
662     #
663     # Required Variables:
664     #     stream:    release stream (eg. boron or carbon)
665     #     branch:    git branch (eg. stable/boron or master)
666
667     project-type: freestyle
668     node: '{build-node}'
669     concurrent: true
670     jdk: '{jdks}'
671
672     logrotate:
673         daysToKeep: '7'
674
675     parameters:
676         - opendaylight-infra-parameters:
677             project: '{project}'
678             branch: '{branch}'
679             refspec: 'refs/heads/{branch}'
680             artifacts: '{archive-artifacts}'
681
682     scm:
683         - gerrit-trigger-scm:
684             refspec: '$GERRIT_REFSPEC'
685             choosing-strategy: 'gerrit'
686
687     wrappers:
688         - opendaylight-infra-wrappers:
689             build-timeout: '{build-timeout}'
690
691     triggers:
692         - gerrit-trigger-patch-submitted:
693             server-name: '{server-name}'
694             name: '{project}'
695             branch: '{branch}'
696
697     builders:
698         - jacoco-nojava-workaround
699         - provide-maven-settings:
700             global-settings-file: 'odl-global-settings'
701             settings-file: '{mvn-settings}'
702         - maven-target:
703             maven-version: '{mvn-version}'
704             goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
705             java-opts:
706                 - '{mvn-opts}'
707             settings: '{mvn-settings}'
708             settings-type: cfp
709             global-settings: 'odl-global-settings'
710             global-settings-type: cfp
711
712     publishers:
713         - findbugs
714         - email-notification:
715             email-recipients: '{email-recipients}'
716             email-prefix: '[{project-name}]'
717         - jacoco-report
718         - opendaylight-infra-shiplogs:
719             maven-version: '{mvn-version}'