refactor git-url to parameter with default value
[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     logrotate:
16         daysToKeep: '{build-days-to-keep}'
17         numToKeep: '{build-num-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     logrotate:
79         daysToKeep: '{build-days-to-keep}'
80         numToKeep: '{build-num-to-keep}'
81         artifactDaysToKeep: '{build-artifact-days-to-keep}'
82         artifactNumToKeep: '{build-artifact-num-to-keep}'
83
84     parameters:
85         - opendaylight-infra-parameters:
86             project: 'integration/distribution'
87             branch: '{branch}'
88             refspec: 'refs/heads/{branch}'
89             artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
90
91     scm:
92         - git-scm:
93             refspec: ''
94             branch: '{branch}'
95
96     wrappers:
97         - opendaylight-infra-wrappers:
98             build-timeout: '{build-timeout}'
99
100     triggers:
101         - reverse:
102             jobs: '{project}-merge-{stream}'
103             result: 'success'
104
105     prebuilders:
106         - provide-maven-settings:
107             global-settings-file: 'odl-global-settings'
108             settings-file: '{mvn-settings}'
109
110     maven:
111         maven-name: 'mvn33'
112         root-pom: 'pom.xml'
113         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'
114         maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
115         settings: 'integration-distribution-settings'
116         settings-type: cfp
117         global-settings: 'odl-global-settings'
118         global-settings-type: cfp
119
120     publishers:
121         - email-notification:
122             email-recipients: '{email-recipients}'
123             email-prefix: '[{project}]'
124         - maven-deploy:
125             id: ''
126             unique-version: true
127             deploy-unstable: false
128         - opendaylight-infra-shiplogs:
129             maven-version: 'mvn33'
130
131 - job-template:
132     # Template: {name}-distribution-check-{stream}
133     # Goal: Build a patch and make sure the distribution can deploy with this change
134     # Operation: This job template builds a patch, creates a distribution containing
135     #            the patch, and triggers the distribution deploy test
136
137     name: '{project-name}-distribution-check-{stream}'
138     disabled: false
139
140     project-type: freestyle
141     node: '{build-node}'
142     concurrent: true
143     jdk: '{jdk}'
144
145     logrotate:
146         daysToKeep: '{build-days-to-keep}'
147         numToKeep: '{build-num-to-keep}'
148         artifactDaysToKeep: '{build-artifact-days-to-keep}'
149         artifactNumToKeep: '{build-artifact-num-to-keep}'
150
151     parameters:
152         - opendaylight-infra-parameters:
153             project: '{project}'
154             branch: '{branch}'
155             refspec: 'refs/heads/{branch}'
156             artifacts: '{archive-artifacts} **/dependency_tree.txt **/target/surefire-reports/*-output.txt'
157         - integration-distribution-git-url:
158             git-url: '{git-url}'
159
160     scm:
161         - integration-gerrit-scm:
162             basedir: '$GERRIT_PROJECT'
163             refspec: '$GERRIT_REFSPEC'
164             branch: '{branch}'
165         - integration-distribution-scm:
166             branch: '{branch}'
167
168     wrappers:
169         - opendaylight-infra-wrappers:
170             # Distro-check jobs typically run within 10 - 30 minutes
171             # with 45 minutes being the occassional edge case.
172             # enforce a 60 minute limit to ensure stuck jobs get
173             # cleared up sooner.
174             build-timeout: '60'
175
176     triggers:
177         - gerrit:
178             server-name: '{server-name}'
179             trigger-on:
180                 - patchset-created-event:
181                     exclude-drafts: 'true'
182                     exclude-trivial-rebase: 'false'
183                     exclude-no-code-change: 'true'
184                 - draft-published-event
185                 - comment-added-contains-event:
186                     comment-contains-value: 'redistcheck'
187                 - comment-added-contains-event:
188                     comment-contains-value: 'recheck'
189             projects:
190               - project-compare-type: 'ANT'
191                 project-pattern: '{project}'
192                 branches:
193                   - branch-compare-type: 'ANT'
194                     branch-pattern: '**/{branch}'
195             skip-vote:
196                 successful: false
197                 failed: false
198                 unstable: false
199                 notbuilt: false
200
201     builders:
202         - maven-target:
203             maven-version: 'mvn33'
204             pom: '$GERRIT_PROJECT/pom.xml'
205             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}'
206             java-opts:
207                 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
208             settings: '{mvn-settings}'
209             settings-type: cfp
210             global-settings: 'odl-global-settings'
211             global-settings-type: cfp
212         - maven-target:
213             maven-version: 'mvn33'
214             pom: 'distribution/pom.xml'
215             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'
216             java-opts:
217               - '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
218             settings: '{mvn-settings}'
219             settings-type: cfp
220             global-settings: 'odl-global-settings'
221             global-settings-type: cfp
222         - integration-distribution-check
223
224     publishers:
225         - email-notification:
226             email-recipients: '{email-recipients}'
227             email-prefix: '[{project-name}]'
228         - postbuildscript:
229             builders:
230                 - shell: |
231                     #!/bin/bash
232                     mkdir -p $WORKSPACE/archives
233                     cp karaf*.log $WORKSPACE/archives
234             script-only-if-succeeded: False
235             script-only-if-failed: False
236             mark-unstable-if-failed: True
237         - archive:
238             artifacts: '*.zip'
239         - opendaylight-infra-shiplogs:
240             maven-version: 'mvn33'
241
242 - job-template:
243     name: '{project-name}-integration-{stream}'
244
245     # Job template for ODL integration verify jobs
246     #
247     # This is similar to a normal verify job, but it runs
248     # when a project that's a dependency of your project
249     # is successfully built.
250     #
251     # Required Variables:
252     #     stream:    release stream (eg. boron or carbon)
253     #     branch:    git branch (eg. stable/boron or master)
254
255     project-type: freestyle
256     node: '{build-node}'
257     jdk: '{jdk}'
258
259     logrotate:
260         daysToKeep: '{build-days-to-keep}'
261         numToKeep: '{build-num-to-keep}'
262         artifactDaysToKeep: '{build-artifact-days-to-keep}'
263         artifactNumToKeep: '{build-artifact-num-to-keep}'
264
265     parameters:
266         - opendaylight-infra-parameters:
267             project: '{project}'
268             branch: '{branch}'
269             refspec: 'refs/heads/{branch}'
270             artifacts: '{archive-artifacts}'
271
272     scm:
273         - git-scm:
274             refspec: ''
275             branch: '{branch}'
276
277     wrappers:
278         - opendaylight-infra-wrappers:
279             build-timeout: '{build-timeout}'
280
281     triggers:
282         - reverse:
283             jobs: '{dependencies}'
284             result: 'success'
285
286     builders:
287         - jacoco-nojava-workaround
288         - provide-maven-settings:
289             global-settings-file: 'odl-global-settings'
290             settings-file: '{mvn-settings}'
291         - maven-target:
292             maven-version: 'mvn33'
293             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
294             java-opts:
295               - '{mvn-opts}'
296             settings: '{mvn-settings}'
297             settings-type: cfp
298             global-settings: 'odl-global-settings'
299             global-settings-type: cfp
300
301     publishers:
302         - email-notification:
303             email-recipients: '{email-recipients}'
304             email-prefix: '{email-upstream}'
305         - findbugs
306         - jacoco-report
307         - opendaylight-infra-shiplogs:
308             maven-version: 'mvn33'
309
310 - job-template:
311     name: '{project-name}-merge-{stream}'
312
313     # Job template for ODL merge jobs
314     #
315     # The purpose of this job template is to setup a ODL merge job
316     # and deploy artifacts to Nexus.
317     #
318     # Required Variables:
319     #     stream:    release stream (eg. boron or carbon)
320     #     branch:    git branch (eg. stable/boron or master)
321
322     # Need to keep jobs that deploy to Nexus at end of build as Maven
323     # projects. Maybe reconsider this once upstream moves deploy to a
324     # separate lifecycle:
325     #     https://issues.apache.org/jira/browse/MNG-5666
326     project-type: maven
327     node: '{build-node}'
328     jdk: '{jdk}'
329
330     logrotate:
331         daysToKeep: '14'
332         numToKeep: '10'
333         artifactDaysToKeep: '{build-artifact-days-to-keep}'
334         artifactNumToKeep: '{build-artifact-num-to-keep}'
335
336     parameters:
337         - opendaylight-infra-parameters:
338             project: '{project}'
339             branch: '{branch}'
340             refspec: 'refs/heads/{branch}'
341             artifacts: '{archive-artifacts}'
342
343     scm:
344         - gerrit-trigger-scm:
345             refspec: ''
346             choosing-strategy: 'default'
347
348     wrappers:
349         - opendaylight-infra-wrappers:
350             build-timeout: '{build-timeout}'
351
352     triggers:
353         - timed: 'H H * * 0'
354         - gerrit-trigger-patch-merged:
355             server-name: '{server-name}'
356             name: '{project}'
357             branch: '{branch}'
358
359     prebuilders:
360         - jacoco-nojava-workaround
361         - provide-maven-settings:
362             global-settings-file: 'odl-global-settings'
363             settings-file: '{mvn-settings}'
364
365     maven:
366         maven-name: 'mvn33'
367         goals: '{mvn-goals} -V -B -Djenkins -Dmerge -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
368         maven-opts: '{mvn-opts}'
369         settings: '{mvn-settings}'
370         settings-type: cfp
371         global-settings: 'odl-global-settings'
372         global-settings-type: cfp
373         post-step-run-condition: UNSTABLE
374
375     postbuilders:
376         - conditional-step:
377             condition-kind: file-exists
378             condition-filename: deploy-site.xml
379             condition-basedir: workspace
380
381             # The strategy here is intentional to run Maven site:deploy twice
382             # once using regular pom.xml to produce a staged-site which is
383             # then used by deploy-site.xml to push to Nexus. This is a
384             # workaround to Maven Site's default linking code which creates
385             # incorrect URLs for sites due to auto-detection assuming your
386             # project is configured in a certain way which ODL is not.
387             steps:
388             - maven-target:
389                 maven-version: 'mvn33'
390                 pom: pom.xml
391                 goals: 'site:deploy -V -B -Dstream={stream}'
392                 java-opts:
393                     - '-Xmx2g'
394                 settings: '{mvn-settings}'
395                 settings-type: cfp
396                 global-settings: 'odl-global-settings'
397                 global-settings-type: cfp
398             - maven-target:
399                 maven-version: 'mvn33'
400                 pom: deploy-site.xml
401                 goals: 'site:deploy -V -B -Dstream={stream}'
402                 java-opts:
403                     - '-Xmx2g'
404                 settings: '{mvn-settings}'
405                 settings-type: cfp
406                 global-settings: 'odl-global-settings'
407                 global-settings-type: cfp
408
409     reporters:
410         - findbugs
411
412     publishers:
413         - email-notification:
414             email-recipients: '{email-recipients}'
415             email-prefix: '[{project-name}]'
416         - maven-deploy:
417             id: ''
418             unique-version: true
419             deploy-unstable: false
420         - jacoco-report
421         - opendaylight-infra-shiplogs:
422             maven-version: 'mvn33'
423
424 - job-template:
425     name: '{project-name}-periodic-{stream}'
426
427     # Job template for periodic builders
428     #
429     # The purpose of this job template is to setup a periodic
430     # builder.
431     #
432     # Required Variables:
433     #     stream:    release stream (eg. boron or carbon)
434     #     branch:    git branch (eg. stable/boron or master)
435
436     project-type: freestyle
437     node: '{build-node}'
438     jdk: '{jdk}'
439
440     logrotate:
441         daysToKeep: '14'
442
443     parameters:
444         - opendaylight-infra-parameters:
445             project: '{project}'
446             branch: '{branch}'
447             refspec: 'refs/heads/{branch}'
448             artifacts: '{archive-artifacts}'
449
450     scm:
451         - git-scm:
452             refspec: ''
453             branch: '{branch}'
454
455     wrappers:
456         - opendaylight-infra-wrappers:
457             build-timeout: '{build-timeout}'
458
459     triggers:
460         - timed: '@daily'
461
462     builders:
463         - jacoco-nojava-workaround
464         - provide-maven-settings:
465             global-settings-file: 'odl-global-settings'
466             settings-file: '{mvn-settings}'
467         - maven-target:
468             maven-version: 'mvn33'
469             goals: '{mvn-goals} -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
470             java-opts:
471               - '{mvn-opts}'
472             settings: '{mvn-settings}'
473             settings-type: cfp
474             global-settings: 'odl-global-settings'
475             global-settings-type: cfp
476
477     publishers:
478         - email-notification:
479             email-recipients: '{email-recipients}'
480             email-prefix: '[{project-name}]'
481         - jacoco-report
482         - findbugs
483         - opendaylight-infra-shiplogs:
484             maven-version: 'mvn33'
485
486 - job-template:
487     name: '{project-name}-sonar'
488     disabled: false
489
490     project-type: freestyle
491     node: '{build-node}'
492     jdk: 'openjdk8'
493
494     logrotate:
495         daysToKeep: '7'
496         numToKeep: '10'
497         artifactDaysToKeep: '1'
498         artifactNumToKeep: '1'
499
500     parameters:
501         - opendaylight-infra-parameters:
502             project: '{project}'
503             branch: '{branch}'
504             refspec: 'refs/heads/{branch}'
505             artifacts: '{archive-artifacts}'
506
507     scm:
508         - git-scm:
509             refspec: ''
510             branch: 'master'
511
512     wrappers:
513         - opendaylight-infra-wrappers:
514             build-timeout: '{build-timeout}'
515
516     triggers:
517         - timed: 'H H * * 6'
518         - gerrit-trigger-patch-sonar:
519             server-name: '{server-name}'
520             name: '{project}'
521
522     builders:
523         - jacoco-nojava-workaround
524         - provide-maven-settings:
525             global-settings-file: 'odl-global-settings'
526             settings-file: '{mvn-settings}'
527         - maven-target:
528             maven-version: 'mvn33'
529             goals: '{mvn-goals} -V -B -Djenkins -Dsonar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
530             maven-opts:
531               - '{mvn-opts}'
532             settings: '{mvn-settings}'
533             settings-type: cfp
534             global-settings: 'odl-global-settings'
535             global-settings-type: cfp
536         - maven-target:
537             maven-version: 'mvn33'
538             # We should switch to the recommended configuration of sonar once
539             # JJB adds support for configurating the Sonar wrapper:
540             #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
541             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'
542             maven-opts:
543               - '{mvn-opts}'
544             settings: '{mvn-settings}'
545             settings-type: cfp
546             global-settings: 'odl-global-settings'
547             global-settings-type: cfp
548
549     publishers:
550         - email-notification:
551             email-recipients: '{email-recipients}'
552             email-prefix: '[{project-name}]'
553         - jacoco-report
554         - findbugs
555         - opendaylight-infra-shiplogs:
556             maven-version: 'mvn33'
557
558 - job-template:
559     name: '{project-name}-validate-autorelease-{stream}'
560     disabled: false
561
562     project-type: freestyle
563     node: '{build-node}'
564     concurrent: true
565     jdk: '{jdk}'
566
567     logrotate:
568         daysToKeep: '7'
569
570     parameters:
571         - opendaylight-infra-parameters:
572             project: '{project}'
573             branch: '{branch}'
574             refspec: 'refs/heads/{branch}'
575             artifacts: '{archive-artifacts}'
576         - autorelease-release-tag:
577             release-tag: 'validate'
578         - autorelease-release-branch:
579             release-branch: '{branch}'
580         - string:
581             name: CLONE_URL
582             default: '{git-url}/releng/autorelease'
583             description: "Autorelease clone URL"
584
585     scm:
586         - git:
587             url: '$CLONE_URL'
588             credentials-id: 'opendaylight-jenkins-ssh'
589             refspec: ''
590             branches:
591                 - 'origin/{branch}'
592             skip-tag: true
593             submodule:
594                 recursive: true
595                 timeout: 60
596
597     wrappers:
598         - opendaylight-infra-wrappers:
599             build-timeout: '{build-timeout}'
600
601     triggers:
602         - gerrit:
603             server-name: '{server-name}'
604             trigger-on:
605                 - patchset-created-event:
606                     exclude-drafts: 'true'
607                     exclude-trivial-rebase: 'false'
608                     exclude-no-code-change: 'true'
609                 - draft-published-event
610                 - comment-added-contains-event:
611                     comment-contains-value: 'recheck'
612                 - comment-added-contains-event:
613                     comment-contains-value: 'revalidate'
614             projects:
615               - project-compare-type: 'ANT'
616                 project-pattern: '{project}'
617                 branches:
618                   - branch-compare-type: 'ANT'
619                     branch-pattern: '**/{branch}'
620                 file-paths:
621                     - compare-type: ANT
622                       pattern: '**/*.xml'
623
624     builders:
625         - jacoco-nojava-workaround
626         - autorelease-checkout-gerrit-patch
627         - autorelease-generate-release-patches
628         - maven-target:
629             maven-version: 'mvn33'
630             pom: validate-pom.xml
631             goals: 'clean install dependency:tree -V -B -T1.5C -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
632             java-opts:
633               - '-Xmx8g'
634             settings: 'autorelease-settings'
635             settings-type: cfp
636             global-settings: 'odl-global-settings'
637             global-settings-type: cfp
638         - maven-target:
639             maven-version: 'mvn33'
640             pom: 'pom.xml'
641             goals: 'clean validate -V -B -Pq -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
642             java-opts:
643               - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
644             settings: 'autorelease-settings'
645             settings-type: cfp
646             global-settings: 'odl-global-settings'
647             global-settings-type: cfp
648         - autorelease-sys-stats
649
650     publishers:
651         - email-notification:
652             email-recipients: '{email-recipients}'
653             email-prefix: '[autorelease] [{project-name}]'
654         - opendaylight-infra-shiplogs:
655             maven-version: 'mvn33'
656
657 - job-template:
658     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
659
660     # Job template for ODL verify jobs
661     #
662     # The purpose of this job template is to setup a ODL verify job
663     #
664     # Required Variables:
665     #     stream:    release stream (eg. boron or carbon)
666     #     branch:    git branch (eg. stable/boron or master)
667
668     project-type: freestyle
669     node: '{build-node}'
670     concurrent: true
671     jdk: '{jdks}'
672
673     logrotate:
674         daysToKeep: '7'
675
676     parameters:
677         - opendaylight-infra-parameters:
678             project: '{project}'
679             branch: '{branch}'
680             refspec: 'refs/heads/{branch}'
681             artifacts: '{archive-artifacts}'
682
683     scm:
684         - gerrit-trigger-scm:
685             refspec: '$GERRIT_REFSPEC'
686             choosing-strategy: 'gerrit'
687
688     wrappers:
689         - opendaylight-infra-wrappers:
690             build-timeout: '{build-timeout}'
691
692     triggers:
693         - gerrit-trigger-patch-submitted:
694             server-name: '{server-name}'
695             name: '{project}'
696             branch: '{branch}'
697
698     builders:
699         - jacoco-nojava-workaround
700         - provide-maven-settings:
701             global-settings-file: 'odl-global-settings'
702             settings-file: '{mvn-settings}'
703         - maven-target:
704             maven-version: '{mvn-version}'
705             goals: '{mvn-goals} -V -B -Djenkins -Dstream={stream} -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
706             java-opts:
707                 - '{mvn-opts}'
708             settings: '{mvn-settings}'
709             settings-type: cfp
710             global-settings: 'odl-global-settings'
711             global-settings-type: cfp
712
713     publishers:
714         - findbugs
715         - email-notification:
716             email-recipients: '{email-recipients}'
717             email-prefix: '[{project-name}]'
718         - jacoco-report
719         - opendaylight-infra-shiplogs:
720             maven-version: '{mvn-version}'