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