Convert distribution jobs to be regular jjb templates
[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: '{name}-clm-{stream}'
10
11     project-type: maven
12     node: dynamic_verify
13     jdk: '{jdk}'
14
15     logrotate:
16         daysToKeep: '{build-days-to-keep}'
17         numToKeep: '{build-num-to-keep}'
18
19     parameters:
20         - project-parameter:
21             project: '{project}'
22
23     scm:
24         - git-scm:
25             refspec: ''
26             branch: '{branch}'
27
28     wrappers:
29         - opendaylight-infra-wrappers:
30             build-timeout: '{build-timeout}'
31
32     triggers:
33         - timed: 'H H * * 6'
34
35     prebuilders:
36         - provide-maven-settings:
37             global-settings-file: 'odl-global-settings'
38             settings-file: '{mvn-settings}'
39
40     maven:
41         maven-name: '{mvn33}'
42         root-pom: 'pom.xml'
43         goals: 'clean install com.sonatype.clm:clm-maven-plugin:index -V -B -Djenkins -DskipTests=true -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
44         maven-opts: '-Xmx4096m -XX:MaxPermSize=512m'
45         settings: '{mvn-settings}'
46         settings-type: cfp
47         global-settings: 'odl-global-settings'
48         global-settings-type: cfp
49
50     postbuilders:
51         - shell: 'find . -regex ".*karaf/target" | xargs rm -rf'
52         - check-clm:
53             application-name: '{name}'
54
55     publishers:
56         - email-notification:
57             email-prefix: '[{name}]'
58         - archive-build:
59             maven-version: '{mvn33}'
60
61 - job-template:
62     name: '{name}-distribution-{stream}'
63
64     # Required variables:
65     #     stream:    release stream (eg. stable-lithium or beryllium)
66     #     branch:    git branch (eg. stable/lithium or master)
67
68     project-type: maven
69     node: dynamic_merge
70     jdk: '{jdk}'
71
72     logrotate:
73         daysToKeep: '{build-days-to-keep}'
74         numToKeep: '{build-num-to-keep}'
75         artifactDaysToKeep: '{build-artifact-days-to-keep}'
76         artifactNumToKeep: '{build-artifact-num-to-keep}'
77
78     parameters:
79         - project-parameter:
80             project: 'integration/distribution'
81
82     scm:
83         - git-scm:
84             refspec: ''
85             branch: '{branch}'
86
87     wrappers:
88         - opendaylight-infra-wrappers:
89             build-timeout: '{build-timeout}'
90
91     triggers:
92         - reverse:
93             jobs: '{project}-merge-{stream}'
94             result: 'success'
95
96     prebuilders:
97         - provide-maven-settings:
98             global-settings-file: 'odl-global-settings'
99             settings-file: '{mvn-settings}'
100
101     maven:
102         maven-name: '{mvn33}'
103         root-pom: 'pom.xml'
104         goals: 'clean install -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
105         maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
106         settings: 'integration-distribution-settings'
107         settings-type: cfp
108         global-settings: 'odl-global-settings'
109         global-settings-type: cfp
110
111     publishers:
112         - email-notification:
113             email-prefix: '[{project}]'
114         - maven-deploy:
115             id: ''
116             unique-version: true
117             deploy-unstable: false
118         - archive-build:
119             maven-version: '{mvn33}'
120
121 - job-template:
122     # Template: integration-patch-distribution-{stream}
123     # Goal: Build a patch and make sure the distribution can deploy with this change
124     # Operation: This job template builds a patch, creates a distribution containing
125     #            the patch, and triggers the distribution deploy test
126
127     name: '{name}-distribution-check-{stream}'
128     disabled: '{obj:disable_distribution_check}'
129
130     project-type: maven
131     node: dynamic_verify
132     concurrent: true
133     jdk: '{jdk}'
134
135     logrotate:
136         daysToKeep: '{build-days-to-keep}'
137         numToKeep: '{build-num-to-keep}'
138         artifactDaysToKeep: '{build-artifact-days-to-keep}'
139         artifactNumToKeep: '{build-artifact-num-to-keep}'
140
141     parameters:
142         - gerrit-parameters:
143             project: '{project}'
144             branch: '{branch}'
145             refspec: 'refs/heads/{branch}'
146         - project-parameter:
147             project: '{project}'
148         - integration-distribution-git-url
149
150     scm:
151         - integration-gerrit-scm:
152             basedir: '$GERRIT_PROJECT'
153             refspec: '$GERRIT_REFSPEC'
154             branch: '{branch}'
155         - integration-distribution-scm:
156             branch: '{branch}'
157
158     wrappers:
159         - opendaylight-infra-wrappers:
160             build-timeout: '{build-timeout}'
161
162     triggers:
163         - gerrit:
164             server-name: 'OpenDaylight'
165             trigger-on:
166                 - patchset-created-event:
167                     exclude-drafts: 'true'
168                     exclude-trivial-rebase: 'false'
169                     exclude-no-code-change: 'true'
170                 - draft-published-event
171                 - comment-added-contains-event:
172                     comment-contains-value: 'test-distribution'
173                 - comment-added-contains-event:
174                     comment-contains-value: 'reverify'
175                 - comment-added-contains-event:
176                     comment-contains-value: 'recheck'
177             projects:
178               - project-compare-type: 'ANT'
179                 project-pattern: '{name}'
180                 branches:
181                   - branch-compare-type: 'ANT'
182                     branch-pattern: '**/{branch}'
183             skip-vote:
184                 successful: false
185                 failed: false
186                 unstable: false
187                 notbuilt: false
188
189     prebuilders:
190         - maven-target:
191             maven-version: '{mvn33}'
192             pom: '$GERRIT_PROJECT/pom.xml'
193             goals: 'clean install -V -B -Djenkins -DskipTests -Dcheckstyle.skip=true -Dmaven.javadoc.skip=true -Dmaven.site.skip=true -DgenerateReports=false -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r -Dstream={stream}'
194             java-opts:
195                 - '-Xmx4096m -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
196             settings: '{mvn-settings}'
197             settings-type: cfp
198             global-settings: 'odl-global-settings'
199             global-settings-type: cfp
200
201     maven:
202         maven-name: '{mvn33}'
203         root-pom: 'distribution/pom.xml'
204         goals: 'clean install -V -B -Djenkins -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r'
205         maven-opts: '-Xmx1024m -XX:MaxPermSize=256m -Dmaven.compile.fork=true'
206         settings: '{mvn-settings}'
207         settings-type: cfp
208         global-settings: 'odl-global-settings'
209         global-settings-type: cfp
210         ignore-upstream-changes: true
211         post-step-run-condition: 'SUCCESS'
212
213     postbuilders:
214         - integration-distribution-check
215
216     publishers:
217         - email-notification:
218             email-prefix: '[{name}]'
219         - postbuildscript:
220             builders:
221                 - shell: |
222                     #!/bin/bash
223                     mkdir -p $WORKSPACE/archives
224                     cp karaf*.log $WORKSPACE/archives
225             script-only-if-succeeded: False
226             script-only-if-failed: False
227             mark-unstable-if-failed: True
228         - archive-build:
229             maven-version: '{mvn33}'