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