Merge "Remove Mongo dependency from Spectrometer"
[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}-sonar'
400     disabled: false
401
402     project-type: freestyle
403     node: '{build-node}'
404     jdk: 'openjdk8'
405
406     properties:
407         - opendaylight-infra-properties:
408             build-days-to-keep: 7
409
410     parameters:
411         - opendaylight-infra-parameters:
412             project: '{project}'
413             branch: '{branch}'
414             refspec: 'refs/heads/{branch}'
415             artifacts: '{archive-artifacts}'
416
417     scm:
418         - git-scm:
419             refspec: ''
420             branch: 'master'
421
422     wrappers:
423         - opendaylight-infra-wrappers:
424             build-timeout: '{build-timeout}'
425
426     triggers:
427         - timed: 'H H * * 6'
428         - gerrit-trigger-patch-sonar:
429             server-name: '{server-name}'
430             name: '{project}'
431             # FIXME: Make sure this does not alter Gerrit votes, then update docs.
432
433     builders:
434         - jacoco-nojava-workaround
435         - provide-maven-settings:
436             global-settings-file: 'odl-global-settings'
437             settings-file: '{mvn-settings}'
438         - maven-target:
439             maven-version: 'mvn33'
440             goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
441             maven-opts:
442               - '{mvn-opts}'
443             settings: '{mvn-settings}'
444             settings-type: cfp
445             global-settings: 'odl-global-settings'
446             global-settings-type: cfp
447         - maven-target:
448             maven-version: 'mvn33'
449             # We should switch to the recommended configuration of sonar once
450             # JJB adds support for configurating the Sonar wrapper:
451             #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
452             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'
453             maven-opts:
454               - '{mvn-opts}'
455             settings: '{mvn-settings}'
456             settings-type: cfp
457             global-settings: 'odl-global-settings'
458             global-settings-type: cfp
459
460     publishers:
461         - email-notification:
462             email-recipients: '{email-recipients}'
463             email-prefix: '[{project-name}]'
464         - jacoco-report
465         - findbugs
466         - opendaylight-infra-shiplogs:
467             maven-version: 'mvn33'
468
469 - job-template:
470     name: '{project-name}-validate-autorelease-{stream}'
471     disabled: false
472
473     project-type: freestyle
474     node: '{build-node}'
475     concurrent: true
476     jdk: '{jdk}'
477
478     properties:
479         - opendaylight-infra-properties:
480             build-days-to-keep: 7
481
482     parameters:
483         - opendaylight-infra-parameters:
484             project: '{project}'
485             branch: '{branch}'
486             refspec: 'refs/heads/{branch}'
487             artifacts: '{archive-artifacts}'
488         - autorelease-release-tag:
489             release-tag: 'validate'
490         - autorelease-release-branch:
491             release-branch: '{branch}'
492         - string:
493             name: CLONE_URL
494             default: '{git-url}/releng/autorelease'
495             description: "Autorelease clone URL"
496
497     scm:
498         - git:
499             url: '$CLONE_URL'
500             credentials-id: 'opendaylight-jenkins-ssh'
501             refspec: ''
502             branches:
503                 - 'origin/{branch}'
504             skip-tag: true
505             submodule:
506                 recursive: true
507                 timeout: 60
508
509     wrappers:
510         - opendaylight-infra-wrappers:
511             build-timeout: '{build-timeout}'
512
513     triggers:
514         - gerrit-trigger-patch-submitted:
515             server: '{server-name}'
516             project: '{project}'
517             branch: '{branch}'
518             files: '**/*.xml'
519
520     builders:
521         - jacoco-nojava-workaround
522         - autorelease-checkout-gerrit-patch
523         - autorelease-generate-release-patches
524         - maven-target:
525             maven-version: 'mvn33'
526             pom: validate-pom.xml
527             goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
528             java-opts:
529               - '-Xmx8g'
530             settings: 'autorelease-settings'
531             settings-type: cfp
532             global-settings: 'odl-global-settings'
533             global-settings-type: cfp
534         - maven-target:
535             maven-version: 'mvn33'
536             pom: 'pom.xml'
537             goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
538             java-opts:
539               - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
540             settings: 'autorelease-settings'
541             settings-type: cfp
542             global-settings: 'odl-global-settings'
543             global-settings-type: cfp
544         - autorelease-sys-stats
545
546     publishers:
547         - email-notification:
548             email-recipients: '{email-recipients}'
549             email-prefix: '[autorelease] [{project-name}]'
550         - opendaylight-infra-shiplogs:
551             maven-version: 'mvn33'
552
553 - job-template:
554     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
555
556     # Job template for ODL verify jobs
557     #
558     # The purpose of this job template is to setup a ODL verify job
559     #
560     # Required Variables:
561     #     stream:    release stream (eg. boron or carbon)
562     #     branch:    git branch (eg. stable/boron or master)
563
564     project-type: freestyle
565     node: '{build-node}'
566     concurrent: true
567     jdk: '{jdks}'
568
569     properties:
570         - opendaylight-infra-properties:
571             build-days-to-keep: 7
572
573     parameters:
574         - opendaylight-infra-parameters:
575             project: '{project}'
576             branch: '{branch}'
577             refspec: 'refs/heads/{branch}'
578             artifacts: '{archive-artifacts}'
579
580     scm:
581         - gerrit-trigger-scm:
582             refspec: '$GERRIT_REFSPEC'
583             choosing-strategy: 'gerrit'
584
585     wrappers:
586         - opendaylight-infra-wrappers:
587             build-timeout: '{build-timeout}'
588
589     triggers:
590         - gerrit-trigger-patch-submitted:
591             server: '{server-name}'
592             project: '{project}'
593             branch: '{branch}'
594             files: '**'
595
596     builders:
597         - jacoco-nojava-workaround
598         - provide-maven-settings:
599             global-settings-file: 'odl-global-settings'
600             settings-file: '{mvn-settings}'
601         - maven-target:
602             maven-version: '{mvn-version}'
603             goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
604             java-opts:
605                 - '{mvn-opts}'
606             settings: '{mvn-settings}'
607             settings-type: cfp
608             global-settings: 'odl-global-settings'
609             global-settings-type: cfp
610
611     publishers:
612         - findbugs
613         - email-notification:
614             email-recipients: '{email-recipients}'
615             email-prefix: '[{project-name}]'
616         - jacoco-report
617         - opendaylight-infra-shiplogs:
618             maven-version: '{mvn-version}'