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