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