Revert "Strengthen distribution-check"
[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. stable-lithium or beryllium)
67     #     branch:    git branch (eg. stable/lithium 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             build-timeout: '{build-timeout}'
168
169     triggers:
170         - gerrit:
171             server-name: 'OpenDaylight'
172             trigger-on:
173                 - patchset-created-event:
174                     exclude-drafts: 'true'
175                     exclude-trivial-rebase: 'false'
176                     exclude-no-code-change: 'true'
177                 - draft-published-event
178                 - comment-added-contains-event:
179                     comment-contains-value: 'test-distribution'
180                 - comment-added-contains-event:
181                     comment-contains-value: 'reverify'
182                 - comment-added-contains-event:
183                     comment-contains-value: 'recheck'
184             projects:
185               - project-compare-type: 'ANT'
186                 project-pattern: '{project}'
187                 branches:
188                   - branch-compare-type: 'ANT'
189                     branch-pattern: '**/{branch}'
190             skip-vote:
191                 successful: false
192                 failed: false
193                 unstable: false
194                 notbuilt: false
195
196     builders:
197         - maven-target:
198             maven-version: '{mvn33}'
199             pom: '$GERRIT_PROJECT/pom.xml'
200             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}'
201             java-opts:
202                 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
203             settings: '{mvn-settings}'
204             settings-type: cfp
205             global-settings: 'odl-global-settings'
206             global-settings-type: cfp
207         - maven-target:
208             maven-version: '{mvn33}'
209             pom: 'distribution/pom.xml'
210             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'
211             java-opts:
212               - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
213             settings: '{mvn-settings}'
214             settings-type: cfp
215             global-settings: 'odl-global-settings'
216             global-settings-type: cfp
217         - integration-distribution-check
218
219     publishers:
220         - email-notification:
221             email-prefix: '[{project-name}]'
222         - postbuildscript:
223             builders:
224                 - shell: |
225                     #!/bin/bash
226                     mkdir -p $WORKSPACE/archives
227                     cp karaf*.log $WORKSPACE/archives
228             script-only-if-succeeded: False
229             script-only-if-failed: False
230             mark-unstable-if-failed: True
231         - archive:
232             artifacts: '*.zip'
233         - opendaylight-infra-shiplogs:
234             maven-version: '{mvn33}'
235
236 - job-template:
237     name: '{project-name}-integration-{stream}'
238
239     # Job template for ODL integration verify jobs
240     #
241     # This is similar to a normal verify job, but it runs
242     # when a project that's a dependency of your project
243     # is successfully built.
244     #
245     # Required Variables:
246     #     stream:    release stream (eg. stable-lithium or beryllium)
247     #     branch:    git branch (eg. stable/lithium or master)
248
249     project-type: freestyle
250     node: '{build-node}'
251     jdk: '{jdk}'
252
253     logrotate:
254         daysToKeep: '{build-days-to-keep}'
255         numToKeep: '{build-num-to-keep}'
256         artifactDaysToKeep: '{build-artifact-days-to-keep}'
257         artifactNumToKeep: '{build-artifact-num-to-keep}'
258
259     parameters:
260         - opendaylight-infra-parameters:
261             project: '{project}'
262             branch: '{branch}'
263             refspec: 'refs/heads/{branch}'
264             artifacts: '{archive-artifacts}'
265
266     scm:
267         - git-scm:
268             refspec: ''
269             branch: '{branch}'
270
271     wrappers:
272         - opendaylight-infra-wrappers:
273             build-timeout: '{build-timeout}'
274
275     triggers:
276         - reverse:
277             jobs: '{dependencies}'
278             result: 'success'
279
280     builders:
281         - jacoco-nojava-workaround
282         - provide-maven-settings:
283             global-settings-file: 'odl-global-settings'
284             settings-file: '{mvn-settings}'
285         - maven-target:
286             maven-version: '{mvn33}'
287             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
288             java-opts:
289               - '{mvn-opts}'
290             settings: '{mvn-settings}'
291             settings-type: cfp
292             global-settings: 'odl-global-settings'
293             global-settings-type: cfp
294
295     publishers:
296         - email-notification:
297             email-prefix: '{email-upstream}'
298         - findbugs
299         - jacoco-report
300         - opendaylight-infra-shiplogs:
301             maven-version: '{mvn33}'
302
303 - job-template:
304     name: '{project-name}-merge-{stream}'
305
306     # Job template for ODL merge jobs
307     #
308     # The purpose of this job template is to setup a ODL merge job
309     # and deploy artifacts to Nexus.
310     #
311     # Required Variables:
312     #     stream:    release stream (eg. stable-lithium or beryllium)
313     #     branch:    git branch (eg. stable/lithium or master)
314
315     # Need to keep jobs that deploy to Nexus at end of build as Maven
316     # projects. Maybe reconsider this once upstream moves deploy to a
317     # separate lifecycle:
318     #     https://issues.apache.org/jira/browse/MNG-5666
319     project-type: maven
320     node: '{build-node}'
321     jdk: '{jdk}'
322
323     logrotate:
324         daysToKeep: '14'
325         numToKeep: '10'
326         artifactDaysToKeep: '{build-artifact-days-to-keep}'
327         artifactNumToKeep: '{build-artifact-num-to-keep}'
328
329     parameters:
330         - opendaylight-infra-parameters:
331             project: '{project}'
332             branch: '{branch}'
333             refspec: 'refs/heads/{branch}'
334             artifacts: '{archive-artifacts}'
335
336     scm:
337         - gerrit-trigger-scm:
338             refspec: ''
339             choosing-strategy: 'default'
340
341     wrappers:
342         - opendaylight-infra-wrappers:
343             build-timeout: '{build-timeout}'
344
345     triggers:
346         - timed: 'H H * * 0'
347         - gerrit-trigger-patch-merged:
348             name: '{project}'
349             branch: '{branch}'
350
351     prebuilders:
352         - jacoco-nojava-workaround
353         - provide-maven-settings:
354             global-settings-file: 'odl-global-settings'
355             settings-file: '{mvn-settings}'
356
357     maven:
358         maven-name: '{mvn33}'
359         goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
360         maven-opts: '{mvn-opts}'
361         settings: '{mvn-settings}'
362         settings-type: cfp
363         global-settings: 'odl-global-settings'
364         global-settings-type: cfp
365         post-step-run-condition: UNSTABLE
366
367     postbuilders:
368         - conditional-step:
369             condition-kind: file-exists
370             condition-filename: deploy-site.xml
371             condition-basedir: workspace
372
373             # The strategy here is intentional to run Maven site:deploy twice
374             # once using regular pom.xml to produce a staged-site which is
375             # then used by deploy-site.xml to push to Nexus. This is a
376             # workaround to Maven Site's default linking code which creates
377             # incorrect URLs for sites due to auto-detection assuming your
378             # project is configured in a certain way which ODL is not.
379             steps:
380             - maven-target:
381                 maven-version: '{mvn33}'
382                 pom: pom.xml
383                 goals: 'site:deploy -V -B -Dstream={stream}'
384                 java-opts:
385                     - '-Xmx2g'
386                 settings: '{mvn-settings}'
387                 settings-type: cfp
388                 global-settings: 'odl-global-settings'
389                 global-settings-type: cfp
390             - maven-target:
391                 maven-version: '{mvn33}'
392                 pom: deploy-site.xml
393                 goals: 'site:deploy -V -B -Dstream={stream}'
394                 java-opts:
395                     - '-Xmx2g'
396                 settings: '{mvn-settings}'
397                 settings-type: cfp
398                 global-settings: 'odl-global-settings'
399                 global-settings-type: cfp
400
401     reporters:
402         - findbugs
403
404     publishers:
405         - email-notification:
406             email-prefix: '[{project-name}]'
407         - maven-deploy:
408             id: ''
409             unique-version: true
410             deploy-unstable: false
411         - jacoco-report
412         - opendaylight-infra-shiplogs:
413             maven-version: '{mvn33}'
414
415 - job-template:
416     name: '{project-name}-periodic-{stream}'
417
418     # Job template for periodic builders
419     #
420     # The purpose of this job template is to setup a periodic
421     # builder.
422     #
423     # Required Variables:
424     #     stream:    release stream (eg. stable-lithium or beryllium)
425     #     branch:    git branch (eg. stable/lithium or master)
426
427     project-type: freestyle
428     node: '{build-node}'
429     jdk: '{jdk}'
430
431     logrotate:
432         daysToKeep: '14'
433
434     parameters:
435         - opendaylight-infra-parameters:
436             project: '{project}'
437             branch: '{branch}'
438             refspec: 'refs/heads/{branch}'
439             artifacts: '{archive-artifacts}'
440
441     scm:
442         - git-scm:
443             refspec: ''
444             branch: '{branch}'
445
446     wrappers:
447         - opendaylight-infra-wrappers:
448             build-timeout: '{build-timeout}'
449
450     triggers:
451         - timed: '@daily'
452
453     builders:
454         - jacoco-nojava-workaround
455         - provide-maven-settings:
456             global-settings-file: 'odl-global-settings'
457             settings-file: '{mvn-settings}'
458         - maven-target:
459             maven-version: '{mvn33}'
460             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
461             java-opts:
462               - '{mvn-opts}'
463             settings: '{mvn-settings}'
464             settings-type: cfp
465             global-settings: 'odl-global-settings'
466             global-settings-type: cfp
467
468     publishers:
469         - email-notification:
470             email-prefix: '[{project-name}]'
471         - jacoco-report
472         - findbugs
473         - opendaylight-infra-shiplogs:
474             maven-version: '{mvn33}'
475
476 - job-template:
477     name: '{project-name}-sonar'
478     disabled: false
479
480     project-type: freestyle
481     node: '{build-node}'
482     jdk: 'openjdk8'
483
484     logrotate:
485         daysToKeep: '7'
486         numToKeep: '10'
487         artifactDaysToKeep: '1'
488         artifactNumToKeep: '1'
489
490     parameters:
491         - opendaylight-infra-parameters:
492             project: '{project}'
493             branch: '{branch}'
494             refspec: 'refs/heads/{branch}'
495             artifacts: '{archive-artifacts}'
496
497     scm:
498         - git-scm:
499             refspec: ''
500             branch: 'master'
501
502     wrappers:
503         - opendaylight-infra-wrappers:
504             build-timeout: '{build-timeout}'
505
506     triggers:
507         - timed: 'H H * * 6'
508         - gerrit-trigger-patch-sonar:
509             name: '{project}'
510
511     builders:
512         - jacoco-nojava-workaround
513         - provide-maven-settings:
514             global-settings-file: 'odl-global-settings'
515             settings-file: '{mvn-settings}'
516         - maven-target:
517             maven-version: '{mvn33}'
518             goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
519             maven-opts:
520               - '{mvn-opts}'
521             settings: '{mvn-settings}'
522             settings-type: cfp
523             global-settings: 'odl-global-settings'
524             global-settings-type: cfp
525         - maven-target:
526             maven-version: '{mvn33}'
527             # We should switch to the recommended configuration of sonar once
528             # JJB adds support for configurating the Sonar wrapper:
529             #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
530             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'
531             maven-opts:
532               - '{mvn-opts}'
533             settings: '{mvn-settings}'
534             settings-type: cfp
535             global-settings: 'odl-global-settings'
536             global-settings-type: cfp
537
538     publishers:
539         - email-notification:
540             email-prefix: '[{project-name}]'
541         - jacoco-report
542         - findbugs
543         - opendaylight-infra-shiplogs:
544             maven-version: '{mvn33}'
545
546 - job-template:
547     name: '{project-name}-validate-autorelease-{stream}'
548     disabled: '{obj:disable_autorelease}'
549
550     project-type: freestyle
551     node: '{build-node}'
552     concurrent: true
553     jdk: '{jdk}'
554
555     logrotate:
556         daysToKeep: '7'
557
558     parameters:
559         - opendaylight-infra-parameters:
560             project: '{project}'
561             branch: '{branch}'
562             refspec: 'refs/heads/{branch}'
563             artifacts: '{archive-artifacts}'
564         - autorelease-release-tag:
565             release-tag: 'validate'
566         - autorelease-release-branch:
567             release-branch: '{branch}'
568         - string:
569             name: CLONE_URL
570             default: 'ssh://jenkins-$SILO@git.opendaylight.org:29418/releng/autorelease'
571             description: "Autorelease clone URL"
572
573     scm:
574         - git:
575             url: '$CLONE_URL'
576             credentials-id: 'opendaylight-jenkins-ssh'
577             refspec: ''
578             branches:
579                 - 'origin/{branch}'
580             skip-tag: true
581             submodule:
582                 recursive: true
583                 timeout: 60
584
585     wrappers:
586         - opendaylight-infra-wrappers:
587             build-timeout: '{build-timeout}'
588
589     triggers:
590         - gerrit:
591             server-name: 'OpenDaylight'
592             trigger-on:
593                 - patchset-created-event:
594                     exclude-drafts: 'true'
595                     exclude-trivial-rebase: 'false'
596                     exclude-no-code-change: 'true'
597                 - draft-published-event
598                 - comment-added-contains-event:
599                     comment-contains-value: 'recheck'
600                 - comment-added-contains-event:
601                     comment-contains-value: 'reverify'
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. stable-lithium or beryllium)
655     #     branch:    git branch (eg. stable/lithium 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}'