Merge "Move genius and lacp to ovs 2.5 image"
[releng/builder.git] / jjb / releng-templates-java.yaml
1 ---
2 - job-template:
3     # Template used for running CLM scans
4     # Arguements:
5     #   {name}         - Project Shortname
6     #   {project}      - Fully qualified project name
7     #   {mvn-settings} - Project maven settings file
8     #   {stream}
9     #   {jdk}
10     name: '{project-name}-clm-{stream}'
11
12     project-type: freestyle
13     node: '{build-node}'
14     jdk: '{jdk}'
15
16     properties:
17       - opendaylight-infra-properties:
18           build-days-to-keep: '{build-days-to-keep}'
19
20     parameters:
21       - opendaylight-infra-parameters:
22           project: '{project}'
23           branch: '{branch}'
24           refspec: 'refs/heads/{branch}'
25           artifacts: '{archive-artifacts}'
26
27     scm:
28       - git-scm:
29           refspec: ''
30           branch: '{branch}'
31
32     wrappers:
33       - opendaylight-infra-wrappers:
34           build-timeout: '{build-timeout}'
35
36     triggers:
37       - timed: 'H H * * 6'
38
39     builders:
40       - provide-maven-settings:
41           global-settings-file: 'odl-global-settings'
42           settings-file: '{mvn-settings}'
43       - maven-target:
44           maven-version: 'mvn33'
45           pom: 'pom.xml'
46           goals: |
47               clean install dependency:tree com.sonatype.clm:clm-maven-plugin:index
48               -Pq
49               {opendaylight-infra-mvn-opts}
50           java-opts:
51             - '-Xmx4096m -XX:MaxPermSize=512m'
52           settings: '{mvn-settings}'
53           settings-type: cfp
54           global-settings: 'odl-global-settings'
55           global-settings-type: cfp
56       - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
57       - check-clm:
58           application-name: '{project-name}'
59
60     publishers:
61       - email-notification:
62           email-recipients: '{email-recipients}'
63           email-prefix: '[{project-name}]'
64       - opendaylight-infra-shiplogs:
65           maven-version: 'mvn33'
66
67 - job-template:
68     # Template: {project-name}-distribution-check-{stream}
69     # Goal: Build a patch and make sure the distribution can deploy with this change.
70     # Operation: This job template builds a patch, creates a distribution containing
71     #            the patch (making sure dependencies are specified),
72     #            and performs the distribution deploy test.
73
74     name: '{project-name}-distribution-check-{stream}'
75     disabled: false
76
77     project-type: freestyle
78     node: '{build-node}'
79     concurrent: true
80     jdk: '{jdk}'
81
82     properties:
83       - opendaylight-infra-properties:
84           build-days-to-keep: '{build-days-to-keep}'
85
86     parameters:
87       - opendaylight-infra-parameters:
88           project: '{project}'
89           branch: '{branch}'
90           refspec: 'refs/heads/{branch}'
91           artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
92       - integration-distribution-git-url:
93           git-url: '{git-url}'
94
95     scm:
96       - integration-gerrit-scm:
97           basedir: '$GERRIT_PROJECT'
98           refspec: '$GERRIT_REFSPEC'
99           branch: '{branch}'
100       - integration-distribution-scm:
101           branch: '{distribution_branch}'
102
103     wrappers:
104       - opendaylight-infra-wrappers:
105           # Distro-check jobs typically run within 10 - 30 minutes
106           # with 45 minutes being the occassional edge case.
107           # enforce a 60 minute limit to ensure stuck jobs get
108           # cleared up sooner.
109           build-timeout: '60'
110
111     triggers:
112       - gerrit-trigger-patch-submitted:
113           server: '{server-name}'
114           project: '{project}'
115           branch: '{branch}'
116           files: '**'
117
118     builders:
119       - distribution-check-wipe
120       - distribution-check-build-project:
121           pom: '$GERRIT_PROJECT/pom.xml'
122       - distribution-check-verify-groupid:
123           gerrit-project: '$GERRIT_PROJECT'
124       - distribution-check-download-deps:
125           dist-pom: 'distribution/pom.xml'
126       - distribution-check-delete-snapshots
127       - distribution-check-configure-remotes
128       - distribution-check-repeat-build:
129           dist-pom: 'distribution/pom.xml'
130       - integration-distribution-check
131
132     publishers:
133       - email-notification:
134           email-recipients: '{email-recipients}'
135           email-prefix: '[{project-name}]'
136       - postbuildscript:
137           builders:
138             - shell: |
139                 #!/bin/bash
140                 mkdir -p $WORKSPACE/archives
141                 cp karaf*.log $WORKSPACE/archives
142           script-only-if-succeeded: false
143           script-only-if-failed: false
144           mark-unstable-if-failed: true
145       - archive:
146           artifacts: '*.zip'
147       - opendaylight-infra-shiplogs:
148           maven-version: 'mvn33'
149
150 - job-template:
151     name: '{project-name}-integration-{stream}'
152
153     # Job template for ODL integration verify jobs
154     #
155     # This is similar to a normal verify job, but it runs
156     # when a project that's a dependency of your project
157     # is successfully built.
158     #
159     # Required Variables:
160     #     stream:    release stream (eg. boron or carbon)
161     #     branch:    git branch (eg. stable/boron or master)
162
163     project-type: freestyle
164     node: '{build-node}'
165     jdk: '{jdk}'
166
167     properties:
168       - opendaylight-infra-properties:
169           build-days-to-keep: '{build-days-to-keep}'
170
171     parameters:
172       - opendaylight-infra-parameters:
173           project: '{project}'
174           branch: '{branch}'
175           refspec: 'refs/heads/{branch}'
176           artifacts: '{archive-artifacts}'
177
178     scm:
179       - git-scm:
180           refspec: ''
181           branch: '{branch}'
182
183     wrappers:
184       - opendaylight-infra-wrappers:
185           build-timeout: '{build-timeout}'
186
187     triggers:
188       - reverse:
189           jobs: '{dependencies}'
190           result: 'success'
191
192     builders:
193       - jacoco-nojava-workaround
194       - provide-maven-settings:
195           global-settings-file: 'odl-global-settings'
196           settings-file: '{mvn-settings}'
197       - maven-target:
198           maven-version: 'mvn33'
199           goals: |
200               {mvn-goals}
201               {opendaylight-infra-mvn-opts}
202           java-opts:
203             - '{mvn-opts}'
204           settings: '{mvn-settings}'
205           settings-type: cfp
206           global-settings: 'odl-global-settings'
207           global-settings-type: cfp
208
209     publishers:
210       - email-notification:
211           email-recipients: '{email-recipients}'
212           email-prefix: '{email-upstream}'
213       - findbugs
214       - jacoco-report
215       - opendaylight-infra-shiplogs:
216           maven-version: 'mvn33'
217
218 - job-template:
219     name: '{project-name}-merge-{stream}'
220
221     # Job template for ODL merge jobs
222     #
223     # The purpose of this job template is to setup a ODL merge job
224     # and deploy artifacts to Nexus.
225     #
226     # Required Variables:
227     #     stream:    release stream (eg. boron or carbon)
228     #     branch:    git branch (eg. stable/boron or master)
229
230     # Need to keep jobs that deploy to Nexus at end of build as Maven
231     # projects. Maybe reconsider this once upstream moves deploy to a
232     # separate lifecycle:
233     #     https://issues.apache.org/jira/browse/MNG-5666
234     project-type: maven
235     node: '{build-node}'
236     jdk: '{jdk}'
237
238     properties:
239       - opendaylight-infra-properties:
240           build-days-to-keep: 14
241
242     parameters:
243       - opendaylight-infra-parameters:
244           project: '{project}'
245           branch: '{branch}'
246           refspec: 'refs/heads/{branch}'
247           artifacts: '{archive-artifacts}'
248
249     scm:
250       - gerrit-trigger-scm:
251           refspec: ''
252           choosing-strategy: 'default'
253
254     wrappers:
255       - opendaylight-infra-wrappers:
256           build-timeout: '{build-timeout}'
257
258     triggers:
259       - timed: 'H H * * 0'
260       - gerrit-trigger-patch-merged:
261           server-name: '{server-name}'
262           name: '{project}'
263           branch: '{branch}'
264
265     prebuilders:
266       - jacoco-nojava-workaround
267       - provide-maven-settings:
268           global-settings-file: 'odl-global-settings'
269           settings-file: '{mvn-settings}'
270
271     # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
272     maven:
273       maven-name: 'mvn33'
274       goals: |
275           {mvn-goals}
276           -Dmerge
277           -Dstream={stream}
278           {opendaylight-infra-mvn-opts}
279       maven-opts: '{mvn-opts}'
280       settings: '{mvn-settings}'
281       settings-type: cfp
282       global-settings: 'odl-global-settings'
283       global-settings-type: cfp
284       post-step-run-condition: UNSTABLE
285
286     postbuilders:
287       - conditional-step:
288           condition-kind: file-exists
289           condition-filename: deploy-site.xml
290           condition-basedir: workspace
291
292           # The strategy here is intentional to run Maven site:deploy twice
293           # once using regular pom.xml to produce a staged-site which is
294           # then used by deploy-site.xml to push to Nexus. This is a
295           # workaround to Maven Site's default linking code which creates
296           # incorrect URLs for sites due to auto-detection assuming your
297           # project is configured in a certain way which ODL is not.
298           steps:
299             - maven-target:
300                 maven-version: 'mvn33'
301                 pom: pom.xml
302                 goals: 'site:deploy -V -B -Dstream={stream}'
303                 java-opts:
304                   - '-Xmx2g'
305                 settings: '{mvn-settings}'
306                 settings-type: cfp
307                 global-settings: 'odl-global-settings'
308                 global-settings-type: cfp
309             - maven-target:
310                 maven-version: 'mvn33'
311                 pom: deploy-site.xml
312                 goals: 'site:deploy -V -B -Dstream={stream}'
313                 java-opts:
314                   - '-Xmx2g'
315                 settings: '{mvn-settings}'
316                 settings-type: cfp
317                 global-settings: 'odl-global-settings'
318                 global-settings-type: cfp
319
320     reporters:
321       - findbugs
322
323     publishers:
324       - email-notification:
325           email-recipients: '{email-recipients}'
326           email-prefix: '[{project-name}]'
327       - maven-deploy:
328           id: ''
329           unique-version: true
330           deploy-unstable: false
331       - jacoco-report
332       - opendaylight-infra-shiplogs:
333           maven-version: 'mvn33'
334       - trigger:
335           project: 'distribution-merge-{stream}'
336           threshold: SUCCESS
337
338 - job-template:
339     name: '{project-name}-sonar'
340     disabled: false
341
342     project-type: freestyle
343     node: '{build-node}'
344     jdk: 'openjdk8'
345
346     properties:
347       - opendaylight-infra-properties:
348           build-days-to-keep: 7
349
350     parameters:
351       - opendaylight-infra-parameters:
352           project: '{project}'
353           branch: '{branch}'
354           refspec: 'refs/heads/{branch}'
355           artifacts: '{archive-artifacts}'
356
357     scm:
358       - git-scm:
359           refspec: ''
360           branch: 'master'
361
362     wrappers:
363       - opendaylight-infra-wrappers:
364           build-timeout: '{build-timeout}'
365
366     triggers:
367       - timed: 'H H * * 6'
368       - gerrit-trigger-patch-sonar:
369           server-name: '{server-name}'
370           name: '{project}'
371           # FIXME: Make sure this does not alter Gerrit votes, then update docs.
372
373     builders:
374       - jacoco-nojava-workaround
375       - provide-maven-settings:
376           global-settings-file: 'odl-global-settings'
377           settings-file: '{mvn-settings}'
378       - maven-target:
379           maven-version: 'mvn33'
380           goals: |
381               {mvn-goals}
382               -Dsonar
383               {opendaylight-infra-mvn-opts}
384           maven-opts:
385             - '{mvn-opts}'
386           settings: '{mvn-settings}'
387           settings-type: cfp
388           global-settings: 'odl-global-settings'
389           global-settings-type: cfp
390       - maven-target:
391           maven-version: 'mvn33'
392           # We should switch to the recommended configuration of sonar once
393           # JJB adds support for configurating the Sonar wrapper:
394           #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
395           goals: |
396               sonar:sonar
397               -Dsonar
398               -Dsonar.host.url=https://sonar.opendaylight.org
399               {opendaylight-infra-mvn-opts}
400           maven-opts:
401             - '{mvn-opts}'
402           settings: '{mvn-settings}'
403           settings-type: cfp
404           global-settings: 'odl-global-settings'
405           global-settings-type: cfp
406
407     publishers:
408       - email-notification:
409           email-recipients: '{email-recipients}'
410           email-prefix: '[{project-name}]'
411       - jacoco-report
412       - findbugs
413       - opendaylight-infra-shiplogs:
414           maven-version: 'mvn33'
415
416 - job-template:
417     name: '{project-name}-validate-autorelease-{stream}'
418     disabled: false
419
420     project-type: freestyle
421     node: '{build-node}'
422     concurrent: true
423     jdk: '{jdk}'
424
425     properties:
426       - opendaylight-infra-properties:
427           build-days-to-keep: 7
428
429     parameters:
430       - opendaylight-infra-parameters:
431           project: '{project}'
432           branch: '{branch}'
433           refspec: 'refs/heads/{branch}'
434           artifacts: '{archive-artifacts}'
435       - autorelease-release-tag:
436           release-tag: 'validate'
437       - autorelease-release-branch:
438           release-branch: '{branch}'
439       - string:
440           name: CLONE_URL
441           default: '{git-url}/releng/autorelease'
442           description: "Autorelease clone URL"
443
444     scm:
445       - git:
446           url: '$CLONE_URL'
447           credentials-id: 'opendaylight-jenkins-ssh'
448           refspec: ''
449           branches:
450             - 'origin/{branch}'
451           skip-tag: true
452           submodule:
453             recursive: true
454             timeout: 60
455
456     wrappers:
457       - opendaylight-infra-wrappers:
458           build-timeout: '{build-timeout}'
459
460     triggers:
461       - gerrit-trigger-patch-submitted:
462           server: '{server-name}'
463           project: '{project}'
464           branch: '{branch}'
465           files: '**/*.xml'
466
467     builders:
468       - jacoco-nojava-workaround
469       - autorelease-checkout-gerrit-patch
470       - autorelease-generate-release-patches
471       # In a perfect world projects should be releasing separately and we consume them
472       # via a project that pulls the release bits from each project from Nexus.
473       # Keep the patches compatible with that ideal, but apply an edit
474       # to enable building in a single maven reactor afterwards.
475       - autorelease-fix-relative-paths
476       - maven-target:
477           maven-version: 'mvn33'
478           pom: validate-pom.xml
479           goals: |
480               clean install dependency:tree
481               -T1.5C
482               -Pq
483               {opendaylight-infra-mvn-opts}
484           java-opts:
485             - '-Xmx8g'
486           settings: 'autorelease-settings'
487           settings-type: cfp
488           global-settings: 'odl-global-settings'
489           global-settings-type: cfp
490       - maven-target:
491           maven-version: 'mvn33'
492           pom: 'pom.xml'
493           goals: |
494               clean validate
495               -Pq
496               {opendaylight-infra-mvn-opts}
497           java-opts:
498             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
499           settings: 'autorelease-settings'
500           settings-type: cfp
501           global-settings: 'odl-global-settings'
502           global-settings-type: cfp
503       - autorelease-sys-stats
504
505     publishers:
506       - email-notification:
507           email-recipients: '{email-recipients}'
508           email-prefix: '[autorelease] [{project-name}]'
509       - opendaylight-infra-shiplogs:
510           maven-version: 'mvn33'
511
512 - job-template:
513     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
514
515     # Job template for ODL verify jobs
516     #
517     # The purpose of this job template is to setup a ODL verify job
518     #
519     # Required Variables:
520     #     stream:    release stream (eg. boron or carbon)
521     #     branch:    git branch (eg. stable/boron or master)
522
523     project-type: freestyle
524     node: '{build-node}'
525     concurrent: true
526     jdk: '{jdks}'
527
528     properties:
529       - opendaylight-infra-properties:
530           build-days-to-keep: 7
531
532     parameters:
533       - opendaylight-infra-parameters:
534           project: '{project}'
535           branch: '{branch}'
536           refspec: 'refs/heads/{branch}'
537           artifacts: '{archive-artifacts}'
538
539     scm:
540       - gerrit-trigger-scm:
541           refspec: '$GERRIT_REFSPEC'
542           choosing-strategy: 'gerrit'
543
544     wrappers:
545       - opendaylight-infra-wrappers:
546           build-timeout: '{build-timeout}'
547
548     triggers:
549       - gerrit-trigger-patch-submitted:
550           server: '{server-name}'
551           project: '{project}'
552           branch: '{branch}'
553           files: '**'
554
555     builders:
556       - jacoco-nojava-workaround
557       - provide-maven-settings:
558           global-settings-file: 'odl-global-settings'
559           settings-file: '{mvn-settings}'
560       - maven-target:
561           maven-version: '{mvn-version}'
562           goals: |
563               {mvn-goals}
564               -Dstream={stream}
565               {opendaylight-infra-mvn-opts}
566           java-opts:
567             - '{mvn-opts}'
568           settings: '{mvn-settings}'
569           settings-type: cfp
570           global-settings: 'odl-global-settings'
571           global-settings-type: cfp
572
573     publishers:
574       - findbugs
575       - email-notification:
576           email-recipients: '{email-recipients}'
577           email-prefix: '[{project-name}]'
578       - jacoco-report
579       - opendaylight-infra-shiplogs:
580           maven-version: '{mvn-version}'