Add refspec to validate-autorelease job
[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: '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: '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       - lf-infra-publish
66
67 - job-template:
68     name: '{project-name}-integration-{stream}'
69
70     # Job template for ODL integration verify jobs
71     #
72     # This is similar to a normal verify job, but it runs
73     # when a project that's a dependency of your project
74     # is successfully built.
75     #
76     # Required Variables:
77     #     stream:    release stream (eg. boron or carbon)
78     #     branch:    git branch (eg. stable/boron or master)
79
80     project-type: freestyle
81     node: '{build-node}'
82     jdk: '{jdk}'
83
84     properties:
85       - opendaylight-infra-properties:
86           build-days-to-keep: '{build-days-to-keep}'
87
88     parameters:
89       - opendaylight-infra-parameters:
90           os-cloud: '{os-cloud}'
91           project: '{project}'
92           branch: '{branch}'
93           refspec: 'refs/heads/{branch}'
94           artifacts: '{archive-artifacts}'
95
96     scm:
97       - git-scm:
98           refspec: ''
99           branch: '{branch}'
100
101     wrappers:
102       - opendaylight-infra-wrappers:
103           build-timeout: '{build-timeout}'
104
105     triggers:
106       - reverse:
107           jobs: '{dependencies}'
108           result: 'success'
109
110     builders:
111       - jacoco-nojava-workaround
112       - provide-maven-settings:
113           global-settings-file: 'global-settings'
114           settings-file: '{mvn-settings}'
115       - maven-target:
116           maven-version: 'mvn33'
117           goals: |
118               {mvn-goals}
119               {opendaylight-infra-mvn-opts}
120           java-opts:
121             - '{mvn-opts}'
122           settings: '{mvn-settings}'
123           settings-type: cfp
124           global-settings: 'global-settings'
125           global-settings-type: cfp
126
127     publishers:
128       - email-notification:
129           email-recipients: '{email-recipients}'
130           email-prefix: '{email-upstream}'
131       - findbugs
132       - jacoco-report
133       - lf-infra-publish
134
135 - job-template:
136     name: '{project-name}-merge-{stream}'
137
138     # Job template for ODL merge jobs
139     #
140     # The purpose of this job template is to setup a ODL merge job
141     # and deploy artifacts to Nexus.
142     #
143     # Required Variables:
144     #     stream:    release stream (eg. boron or carbon)
145     #     branch:    git branch (eg. stable/boron or master)
146
147     # Need to keep jobs that deploy to Nexus at end of build as Maven
148     # projects. Maybe reconsider this once upstream moves deploy to a
149     # separate lifecycle:
150     #     https://issues.apache.org/jira/browse/MNG-5666
151     project-type: maven
152     node: '{build-node}'
153     jdk: '{jdk}'
154
155     properties:
156       - opendaylight-infra-properties:
157           build-days-to-keep: 14
158
159     parameters:
160       - opendaylight-infra-parameters:
161           os-cloud: '{os-cloud}'
162           project: '{project}'
163           branch: '{branch}'
164           refspec: 'refs/heads/{branch}'
165           artifacts: '{archive-artifacts}'
166       - string:
167           name: STREAM
168           default: '{stream}'
169           description: "String representing release name"
170
171     scm:
172       - gerrit-trigger-scm:
173           refspec: ''
174           choosing-strategy: 'default'
175
176     wrappers:
177       - opendaylight-infra-wrappers:
178           build-timeout: '{build-timeout}'
179
180     triggers:
181       - timed: 'H H * * 0'
182       - gerrit-trigger-patch-merged:
183           server-name: '{server-name}'
184           name: '{project}'
185           branch: '{branch}'
186
187     prebuilders:
188       - jacoco-nojava-workaround
189       - provide-maven-settings:
190           global-settings-file: 'global-settings'
191           settings-file: '{mvn-settings}'
192
193     # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
194     maven:
195       maven-name: 'mvn33'
196       goals: >
197           {mvn-goals}
198           -Dmerge
199           -Dstream={stream}
200           {opendaylight-infra-mvn-opts}
201       maven-opts: '{mvn-opts}'
202       settings: '{mvn-settings}'
203       settings-type: cfp
204       global-settings: 'global-settings'
205       global-settings-type: cfp
206       post-step-run-condition: UNSTABLE
207
208     postbuilders:
209       - conditional-step:
210           condition-kind: file-exists
211           condition-filename: deploy-site.xml
212           condition-basedir: workspace
213
214           # The strategy here is intentional to run Maven site:deploy twice
215           # once using regular pom.xml to produce a staged-site which is
216           # then used by deploy-site.xml to push to Nexus. This is a
217           # workaround to Maven Site's default linking code which creates
218           # incorrect URLs for sites due to auto-detection assuming your
219           # project is configured in a certain way which ODL is not.
220           steps:
221             - maven-target:
222                 maven-version: 'mvn33'
223                 pom: pom.xml
224                 goals: 'site:deploy -V -B -Dstream={stream}'
225                 java-opts:
226                   - '-Xmx2g'
227                 settings: '{mvn-settings}'
228                 settings-type: cfp
229                 global-settings: 'global-settings'
230                 global-settings-type: cfp
231             - opendaylight-infra-deploy-maven-site:
232                 settings-file: '{mvn-settings}'
233
234     reporters:
235       - findbugs
236
237     publishers:
238       - email-notification:
239           email-recipients: '{email-recipients}'
240           email-prefix: '[{project-name}]'
241       - maven-deploy:
242           id: ''
243           unique-version: true
244           deploy-unstable: false
245       - jacoco-report
246       - lf-infra-publish
247       - trigger:
248           project: 'distribution-merge-{stream}'
249           threshold: SUCCESS
250
251 - job-template:
252     name: '{project-name}-sonar'
253     disabled: false
254
255     project-type: freestyle
256     node: '{build-node}'
257     jdk: 'openjdk8'
258
259     properties:
260       - opendaylight-infra-properties:
261           build-days-to-keep: 7
262
263     parameters:
264       - opendaylight-infra-parameters:
265           os-cloud: '{os-cloud}'
266           project: '{project}'
267           branch: '{branch}'
268           refspec: 'refs/heads/{branch}'
269           artifacts: '{archive-artifacts}'
270
271     scm:
272       - git-scm:
273           refspec: ''
274           branch: 'master'
275
276     wrappers:
277       - opendaylight-infra-wrappers:
278           build-timeout: '{build-timeout}'
279
280     triggers:
281       - timed: 'H H * * 6'
282       - gerrit-trigger-patch-sonar:
283           server-name: '{server-name}'
284           name: '{project}'
285           # FIXME: Make sure this does not alter Gerrit votes, then update docs.
286
287     builders:
288       - jacoco-nojava-workaround
289       - provide-maven-settings:
290           global-settings-file: 'global-settings'
291           settings-file: '{mvn-settings}'
292       - maven-target:
293           maven-version: 'mvn33'
294           goals: |
295               {mvn-goals}
296               -Dsonar
297               {opendaylight-infra-mvn-opts}
298           maven-opts:
299             - '{mvn-opts}'
300           settings: '{mvn-settings}'
301           settings-type: cfp
302           global-settings: 'global-settings'
303           global-settings-type: cfp
304       - maven-target:
305           maven-version: 'mvn33'
306           # We should switch to the recommended configuration of sonar once
307           # JJB adds support for configurating the Sonar wrapper:
308           #    http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Jenkins
309           goals: |
310               sonar:sonar
311               -Dsonar
312               -Dsonar.host.url=https://sonar.opendaylight.org
313               {opendaylight-infra-mvn-opts}
314           maven-opts:
315             - '{mvn-opts}'
316           settings: '{mvn-settings}'
317           settings-type: cfp
318           global-settings: 'global-settings'
319           global-settings-type: cfp
320
321     publishers:
322       - email-notification:
323           email-recipients: '{email-recipients}'
324           email-prefix: '[{project-name}]'
325       - jacoco-report
326       - findbugs
327       - lf-infra-publish
328
329 - job-template:
330     name: '{project-name}-validate-autorelease-{stream}'
331     disabled: false
332
333     project-type: freestyle
334     node: '{build-node}'
335     concurrent: true
336     jdk: '{jdk}'
337
338     properties:
339       - opendaylight-infra-properties:
340           build-days-to-keep: 7
341
342     parameters:
343       - opendaylight-infra-parameters:
344           os-cloud: '{os-cloud}'
345           project: '{project}'
346           branch: '{branch}'
347           refspec: 'refs/heads/{branch}'
348           artifacts: '{archive-artifacts}'
349       - autorelease-release-tag:
350           release-tag: 'validate'
351       - autorelease-release-branch:
352           release-branch: '{branch}'
353       - string:
354           name: CLONE_URL
355           default: '{git-url}/releng/autorelease'
356           description: "Autorelease clone URL"
357
358     scm:
359       - git:
360           url: '$CLONE_URL'
361           credentials-id: 'opendaylight-jenkins-ssh'
362           refspec: '$GERRIT_REFSPEC'
363           branches:
364             - 'origin/{branch}'
365           skip-tag: true
366           submodule:
367             recursive: true
368             timeout: 60
369           choosing-strategy: gerrit
370
371     wrappers:
372       - opendaylight-infra-wrappers:
373           build-timeout: '{build-timeout}'
374
375     triggers:
376       - gerrit-trigger-patch-submitted:
377           server: '{server-name}'
378           project: '{project}'
379           branch: '{branch}'
380           files: '**/*.xml'
381
382     builders:
383       - jacoco-nojava-workaround
384       - autorelease-checkout-gerrit-patch
385       - autorelease-generate-release-patches
386       # In a perfect world projects should be releasing separately and we consume them
387       # via a project that pulls the release bits from each project from Nexus.
388       # Keep the patches compatible with that ideal, but apply an edit
389       # to enable building in a single maven reactor afterwards.
390       - autorelease-fix-relative-paths
391       - maven-target:
392           maven-version: 'mvn33'
393           pom: validate-pom.xml
394           goals: |
395               clean install dependency:tree
396               -T1.5C
397               -Pq
398               {opendaylight-infra-mvn-opts}
399           java-opts:
400             - '-Xmx8g'
401           settings: 'autorelease-settings'
402           settings-type: cfp
403           global-settings: 'global-settings'
404           global-settings-type: cfp
405       - maven-target:
406           maven-version: 'mvn33'
407           pom: 'pom.xml'
408           goals: |
409               clean validate
410               -Pq
411               {opendaylight-infra-mvn-opts}
412           java-opts:
413             - '-Xmx8g -XX:MaxPermSize=1024m -Dmaven.compile.fork=true'
414           settings: 'autorelease-settings'
415           settings-type: cfp
416           global-settings: 'global-settings'
417           global-settings-type: cfp
418
419     publishers:
420       - email-notification:
421           email-recipients: '{email-recipients}'
422           email-prefix: '[autorelease] [{project-name}]'
423       - lf-infra-publish
424
425 - job-template:
426     name: '{project-name}-verify-{stream}-{maven}-{jdks}'
427
428     # Job template for ODL verify jobs
429     #
430     # The purpose of this job template is to setup a ODL verify job
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     concurrent: true
439     jdk: '{jdks}'
440
441     properties:
442       - opendaylight-infra-properties:
443           build-days-to-keep: 7
444
445     parameters:
446       - opendaylight-infra-parameters:
447           os-cloud: '{os-cloud}'
448           project: '{project}'
449           branch: '{branch}'
450           refspec: 'refs/heads/{branch}'
451           artifacts: '{archive-artifacts}'
452
453     scm:
454       - gerrit-trigger-scm:
455           refspec: '$GERRIT_REFSPEC'
456           choosing-strategy: 'gerrit'
457
458     wrappers:
459       - opendaylight-infra-wrappers:
460           build-timeout: '{build-timeout}'
461
462     triggers:
463       - gerrit-trigger-patch-submitted:
464           server: '{server-name}'
465           project: '{project}'
466           branch: '{branch}'
467           files: '**'
468
469     builders:
470       - jacoco-nojava-workaround
471       - provide-maven-settings:
472           global-settings-file: 'global-settings'
473           settings-file: '{mvn-settings}'
474       - maven-target:
475           maven-version: '{mvn-version}'
476           goals: |
477               {mvn-goals}
478               -Dstream={stream}
479               {opendaylight-infra-mvn-opts}
480           java-opts:
481             - '{mvn-opts}'
482           settings: '{mvn-settings}'
483           settings-type: cfp
484           global-settings: 'global-settings'
485           global-settings-type: cfp
486
487     publishers:
488       - findbugs
489       - email-notification:
490           email-recipients: '{email-recipients}'
491           email-prefix: '[{project-name}]'
492       - jacoco-report
493       - lf-infra-publish