Merge "refactor ovsdb patch test and add ability to trigger netvirt csit"
[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     properties:
16         - opendaylight-infra-properties:
17             build-days-to-keep: '{build-days-to-keep}'
18
19     parameters:
20         - opendaylight-infra-parameters:
21             project: '{project}'
22             branch: '{branch}'
23             refspec: 'refs/heads/{branch}'
24             artifacts: '{archive-artifacts}'
25
26     scm:
27         - git-scm:
28             refspec: ''
29             branch: '{branch}'
30
31     wrappers:
32         - opendaylight-infra-wrappers:
33             build-timeout: '{build-timeout}'
34
35     triggers:
36         - timed: 'H H * * 6'
37
38     builders:
39         - provide-maven-settings:
40             global-settings-file: 'odl-global-settings'
41             settings-file: '{mvn-settings}'
42         - maven-target:
43             maven-version: 'mvn33'
44             pom: 'pom.xml'
45             goals: 'clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
46             java-opts:
47               - '-Xmx4096m -XX:MaxPermSize=512m'
48             settings: '{mvn-settings}'
49             settings-type: cfp
50             global-settings: 'odl-global-settings'
51             global-settings-type: cfp
52         - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
53         - check-clm:
54             application-name: '{project-name}'
55
56     publishers:
57         - email-notification:
58             email-recipients: '{email-recipients}'
59             email-prefix: '[{project-name}]'
60         - opendaylight-infra-shiplogs:
61             maven-version: 'mvn33'
62
63 - job-template:
64     name: '{project-name}-distribution-{stream}'
65
66     # Required variables:
67     #     stream:    release stream (eg. boron or carbon)
68     #     branch:    git branch (eg. stable/boron or master)
69
70     # Need to keep jobs that deploy to Nexus at end of build as Maven
71     # projects. Maybe reconsider this once upstream moves deploy to a
72     # separate lifecycle:
73     #     https://issues.apache.org/jira/browse/MNG-5666
74     project-type: maven
75     node: '{build-node}'
76     jdk: '{jdk}'
77
78     properties:
79         - opendaylight-infra-properties:
80             build-days-to-keep: '{build-days-to-keep}'
81
82     parameters:
83         - opendaylight-infra-parameters:
84             project: 'integration/distribution'
85             branch: '{branch}'
86             refspec: 'refs/heads/{branch}'
87             artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
88
89     scm:
90         - git-scm:
91             refspec: ''
92             branch: '{branch}'
93
94     wrappers:
95         - opendaylight-infra-wrappers:
96             build-timeout: '{build-timeout}'
97
98     triggers:
99         - reverse:
100             jobs: '{project}-merge-{stream}'
101             result: 'success'
102
103     prebuilders:
104         - provide-maven-settings:
105             global-settings-file: 'odl-global-settings'
106             settings-file: '{mvn-settings}'
107
108     maven:
109         maven-name: 'mvn33'
110         root-pom: 'pom.xml'
111         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'
112         maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
113         settings: 'integration-distribution-settings'
114         settings-type: cfp
115         global-settings: 'odl-global-settings'
116         global-settings-type: cfp
117
118     publishers:
119         - email-notification:
120             email-recipients: '{email-recipients}'
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: false
137
138     project-type: freestyle
139     node: '{build-node}'
140     concurrent: true
141     jdk: '{jdk}'
142
143     properties:
144         - opendaylight-infra-properties:
145             build-days-to-keep: '{build-days-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 **/target/surefire-reports/*-output.txt'
153         - integration-distribution-git-url:
154             git-url: '{git-url}'
155
156     scm:
157         - integration-gerrit-scm:
158             basedir: '$GERRIT_PROJECT'
159             refspec: '$GERRIT_REFSPEC'
160             branch: '{branch}'
161         - integration-distribution-scm:
162             branch: '{branch}'
163
164     wrappers:
165         - opendaylight-infra-wrappers:
166             # Distro-check jobs typically run within 10 - 30 minutes
167             # with 45 minutes being the occassional edge case.
168             # enforce a 60 minute limit to ensure stuck jobs get
169             # cleared up sooner.
170             build-timeout: '60'
171
172     triggers:
173         - gerrit-trigger-patch-submitted:
174             server: '{server-name}'
175             project: '{project}'
176             branch: '{branch}'
177             files: '**'
178
179     builders:
180         - maven-target:
181             maven-version: 'mvn33'
182             pom: '$GERRIT_PROJECT/pom.xml'
183             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}'
184             java-opts:
185                 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
186             settings: '{mvn-settings}'
187             settings-type: cfp
188             global-settings: 'odl-global-settings'
189             global-settings-type: cfp
190         - maven-target:
191             maven-version: 'mvn33'
192             pom: 'distribution/pom.xml'
193             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'
194             java-opts:
195               - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
196             settings: '{mvn-settings}'
197             settings-type: cfp
198             global-settings: 'odl-global-settings'
199             global-settings-type: cfp
200         - integration-distribution-check
201
202     publishers:
203         - email-notification:
204             email-recipients: '{email-recipients}'
205             email-prefix: '[{project-name}]'
206         - postbuildscript:
207             builders:
208                 - shell: |
209                     #!/bin/bash
210                     mkdir -p $WORKSPACE/archives
211                     cp karaf*.log $WORKSPACE/archives
212             script-only-if-succeeded: False
213             script-only-if-failed: False
214             mark-unstable-if-failed: True
215         - archive:
216             artifacts: '*.zip'
217         - opendaylight-infra-shiplogs:
218             maven-version: 'mvn33'
219
220 - job-template:
221     name: '{project-name}-integration-{stream}'
222
223     # Job template for ODL integration verify jobs
224     #
225     # This is similar to a normal verify job, but it runs
226     # when a project that's a dependency of your project
227     # is successfully built.
228     #
229     # Required Variables:
230     #     stream:    release stream (eg. boron or carbon)
231     #     branch:    git branch (eg. stable/boron or master)
232
233     project-type: freestyle
234     node: '{build-node}'
235     jdk: '{jdk}'
236
237     properties:
238         - opendaylight-infra-properties:
239             build-days-to-keep: '{build-days-to-keep}'
240
241     parameters:
242         - opendaylight-infra-parameters:
243             project: '{project}'
244             branch: '{branch}'
245             refspec: 'refs/heads/{branch}'
246             artifacts: '{archive-artifacts}'
247
248     scm:
249         - git-scm:
250             refspec: ''
251             branch: '{branch}'
252
253     wrappers:
254         - opendaylight-infra-wrappers:
255             build-timeout: '{build-timeout}'
256
257     triggers:
258         - reverse:
259             jobs: '{dependencies}'
260             result: 'success'
261
262     builders:
263         - jacoco-nojava-workaround
264         - provide-maven-settings:
265             global-settings-file: 'odl-global-settings'
266             settings-file: '{mvn-settings}'
267         - maven-target:
268             maven-version: 'mvn33'
269             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
270             java-opts:
271               - '{mvn-opts}'
272             settings: '{mvn-settings}'
273             settings-type: cfp
274             global-settings: 'odl-global-settings'
275             global-settings-type: cfp
276
277     publishers:
278         - email-notification:
279             email-recipients: '{email-recipients}'
280             email-prefix: '{email-upstream}'
281         - findbugs
282         - jacoco-report
283         - opendaylight-infra-shiplogs:
284             maven-version: 'mvn33'
285
286 - job-template:
287     name: '{project-name}-merge-{stream}'
288
289     # Job template for ODL merge jobs
290     #
291     # The purpose of this job template is to setup a ODL merge job
292     # and deploy artifacts to Nexus.
293     #
294     # Required Variables:
295     #     stream:    release stream (eg. boron or carbon)
296     #     branch:    git branch (eg. stable/boron or master)
297
298     # Need to keep jobs that deploy to Nexus at end of build as Maven
299     # projects. Maybe reconsider this once upstream moves deploy to a
300     # separate lifecycle:
301     #     https://issues.apache.org/jira/browse/MNG-5666
302     project-type: maven
303     node: '{build-node}'
304     jdk: '{jdk}'
305
306     properties:
307         - opendaylight-infra-properties:
308             build-days-to-keep: 14
309
310     parameters:
311         - opendaylight-infra-parameters:
312             project: '{project}'
313             branch: '{branch}'
314             refspec: 'refs/heads/{branch}'
315             artifacts: '{archive-artifacts}'
316
317     scm:
318         - gerrit-trigger-scm:
319             refspec: ''
320             choosing-strategy: 'default'
321
322     wrappers:
323         - opendaylight-infra-wrappers:
324             build-timeout: '{build-timeout}'
325
326     triggers:
327         - timed: 'H H * * 0'
328         - gerrit-trigger-patch-merged:
329             server-name: '{server-name}'
330             name: '{project}'
331             branch: '{branch}'
332
333     prebuilders:
334         - jacoco-nojava-workaround
335         - provide-maven-settings:
336             global-settings-file: 'odl-global-settings'
337             settings-file: '{mvn-settings}'
338
339     maven:
340         maven-name: 'mvn33'
341         goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
342         maven-opts: '{mvn-opts}'
343         settings: '{mvn-settings}'
344         settings-type: cfp
345         global-settings: 'odl-global-settings'
346         global-settings-type: cfp
347         post-step-run-condition: UNSTABLE
348
349     postbuilders:
350         - conditional-step:
351             condition-kind: file-exists
352             condition-filename: deploy-site.xml
353             condition-basedir: workspace
354
355             # The strategy here is intentional to run Maven site:deploy twice
356             # once using regular pom.xml to produce a staged-site which is
357             # then used by deploy-site.xml to push to Nexus. This is a
358             # workaround to Maven Site's default linking code which creates
359             # incorrect URLs for sites due to auto-detection assuming your
360             # project is configured in a certain way which ODL is not.
361             steps:
362             - maven-target:
363                 maven-version: 'mvn33'
364                 pom: pom.xml
365                 goals: 'site:deploy -V -B -Dstream={stream}'
366                 java-opts:
367                     - '-Xmx2g'
368                 settings: '{mvn-settings}'
369                 settings-type: cfp
370                 global-settings: 'odl-global-settings'
371                 global-settings-type: cfp
372             - maven-target:
373                 maven-version: 'mvn33'
374                 pom: deploy-site.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
383     reporters:
384         - findbugs
385
386     publishers:
387         - email-notification:
388             email-recipients: '{email-recipients}'
389             email-prefix: '[{project-name}]'
390         - maven-deploy:
391             id: ''
392             unique-version: true
393             deploy-unstable: false
394         - jacoco-report
395         - opendaylight-infra-shiplogs:
396             maven-version: 'mvn33'
397
398 - job-template:
399     name: '{project-name}-periodic-{stream}'
400
401     # Job template for periodic builders
402     #
403     # The purpose of this job template is to setup a periodic
404     # builder.
405     #
406     # Required Variables:
407     #     stream:    release stream (eg. boron or carbon)
408     #     branch:    git branch (eg. stable/boron or master)
409
410     project-type: freestyle
411     node: '{build-node}'
412     jdk: '{jdk}'
413
414     properties:
415         - opendaylight-infra-properties:
416             build-days-to-keep: 14
417
418     parameters:
419         - opendaylight-infra-parameters:
420             project: '{project}'
421             branch: '{branch}'
422             refspec: 'refs/heads/{branch}'
423             artifacts: '{archive-artifacts}'
424
425     scm:
426         - git-scm:
427             refspec: ''
428             branch: '{branch}'
429
430     wrappers:
431         - opendaylight-infra-wrappers:
432             build-timeout: '{build-timeout}'
433
434     triggers:
435         - timed: '@daily'
436
437     builders:
438         - jacoco-nojava-workaround
439         - provide-maven-settings:
440             global-settings-file: 'odl-global-settings'
441             settings-file: '{mvn-settings}'
442         - maven-target:
443             maven-version: 'mvn33'
444             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
445             java-opts:
446               - '{mvn-opts}'
447             settings: '{mvn-settings}'
448             settings-type: cfp
449             global-settings: 'odl-global-settings'
450             global-settings-type: cfp
451
452     publishers:
453         - email-notification:
454             email-recipients: '{email-recipients}'
455             email-prefix: '[{project-name}]'
456         - jacoco-report
457         - findbugs
458         - opendaylight-infra-shiplogs:
459             maven-version: 'mvn33'
460
461 - job-template:
462     name: '{project-name}-sonar'
463     disabled: false
464
465     project-type: freestyle
466     node: '{build-node}'
467     jdk: 'openjdk8'
468
469     properties:
470         - opendaylight-infra-properties:
471             build-days-to-keep: 7
472
473     parameters:
474         - opendaylight-infra-parameters:
475             project: '{project}'
476             branch: '{branch}'
477             refspec: 'refs/heads/{branch}'
478             artifacts: '{archive-artifacts}'
479
480     scm:
481         - git-scm:
482             refspec: ''
483             branch: 'master'
484
485     wrappers:
486         - opendaylight-infra-wrappers:
487             build-timeout: '{build-timeout}'
488
489     triggers:
490         - timed: 'H H * * 6'
491         - gerrit-trigger-patch-sonar:
492             server-name: '{server-name}'
493             name: '{project}'
494             # FIXME: Make sure this does not alter Gerrit votes, then update docs.
495
496     builders:
497         - jacoco-nojava-workaround
498         - provide-maven-settings:
499             global-settings-file: 'odl-global-settings'
500             settings-file: '{mvn-settings}'
501         - maven-target:
502             maven-version: 'mvn33'
503             goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
504             maven-opts:
505               - '{mvn-opts}'
506             settings: '{mvn-settings}'
507             settings-type: cfp
508             global-settings: 'odl-global-settings'
509             global-settings-type: cfp
510         - maven-target:
511             maven-version: 'mvn33'
512             # We should switch to the recommended configuration of sonar once
513             # JJB adds support for configurating the Sonar wrapper:
514             #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
515             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'
516             maven-opts:
517               - '{mvn-opts}'
518             settings: '{mvn-settings}'
519             settings-type: cfp
520             global-settings: 'odl-global-settings'
521             global-settings-type: cfp
522
523     publishers:
524         - email-notification:
525             email-recipients: '{email-recipients}'
526             email-prefix: '[{project-name}]'
527         - jacoco-report
528         - findbugs
529         - opendaylight-infra-shiplogs:
530             maven-version: 'mvn33'
531
532 - job-template:
533     name: '{project-name}-validate-autorelease-{stream}'
534     disabled: false
535
536     project-type: freestyle
537     node: '{build-node}'
538     concurrent: true
539     jdk: '{jdk}'
540
541     properties:
542         - opendaylight-infra-properties:
543             build-days-to-keep: 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: '{git-url}/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-trigger-patch-submitted:
578             server: '{server-name}'
579             project: '{project}'
580             branch: '{branch}'
581             files: '**/*.xml'
582
583     builders:
584         - jacoco-nojava-workaround
585         - autorelease-checkout-gerrit-patch
586         - autorelease-generate-release-patches
587         - maven-target:
588             maven-version: 'mvn33'
589             pom: validate-pom.xml
590             goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
591             java-opts:
592               - '-Xmx8g'
593             settings: 'autorelease-settings'
594             settings-type: cfp
595             global-settings: 'odl-global-settings'
596             global-settings-type: cfp
597         - maven-target:
598             maven-version: 'mvn33'
599             pom: 'pom.xml'
600             goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
601             java-opts:
602               - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
603             settings: 'autorelease-settings'
604             settings-type: cfp
605             global-settings: 'odl-global-settings'
606             global-settings-type: cfp
607         - autorelease-sys-stats
608
609     publishers:
610         - email-notification:
611             email-recipients: '{email-recipients}'
612             email-prefix: '[autorelease] [{project-name}]'
613         - opendaylight-infra-shiplogs:
614             maven-version: 'mvn33'
615
616 - job-template:
617     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
618
619     # Job template for ODL verify jobs
620     #
621     # The purpose of this job template is to setup a ODL verify job
622     #
623     # Required Variables:
624     #     stream:    release stream (eg. boron or carbon)
625     #     branch:    git branch (eg. stable/boron or master)
626
627     project-type: freestyle
628     node: '{build-node}'
629     concurrent: true
630     jdk: '{jdks}'
631
632     properties:
633         - opendaylight-infra-properties:
634             build-days-to-keep: 7
635
636     parameters:
637         - opendaylight-infra-parameters:
638             project: '{project}'
639             branch: '{branch}'
640             refspec: 'refs/heads/{branch}'
641             artifacts: '{archive-artifacts}'
642
643     scm:
644         - gerrit-trigger-scm:
645             refspec: '$GERRIT_REFSPEC'
646             choosing-strategy: 'gerrit'
647
648     wrappers:
649         - opendaylight-infra-wrappers:
650             build-timeout: '{build-timeout}'
651
652     triggers:
653         - gerrit-trigger-patch-submitted:
654             server: '{server-name}'
655             project: '{project}'
656             branch: '{branch}'
657             files: '**'
658
659     builders:
660         - jacoco-nojava-workaround
661         - provide-maven-settings:
662             global-settings-file: 'odl-global-settings'
663             settings-file: '{mvn-settings}'
664         - maven-target:
665             maven-version: '{mvn-version}'
666             goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
667             java-opts:
668                 - '{mvn-opts}'
669             settings: '{mvn-settings}'
670             settings-type: cfp
671             global-settings: 'odl-global-settings'
672             global-settings-type: cfp
673
674     publishers:
675         - findbugs
676         - email-notification:
677             email-recipients: '{email-recipients}'
678             email-prefix: '[{project-name}]'
679         - jacoco-report
680         - opendaylight-infra-shiplogs:
681             maven-version: '{mvn-version}'