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