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