Set default java-version for odl-merge job
[releng/builder.git] / jjb / releng-templates-java.yaml
1 ---
2 - job-group:
3     name: odl-maven-jobs
4
5     jobs:
6       - gerrit-maven-clm
7
8       # TODO: Figure out what's wrong with the gerrit-maven-merge job.
9       # - gerrit-maven-merge:
10       #     post_build_trigger:
11       #       - project:
12       #           - 'distribution-merge-{stream}'
13       #         condition: SUCCESS
14       #         trigger-with-no-params: true
15       - '{project-name}-merge-{stream}':
16           mvn-goals: clean install -V -Dmaven.compile.fork=true -Dintegrationtests -Dvtn.build.jobs=2
17
18       - gerrit-maven-release
19       - gerrit-maven-verify
20       - gerrit-maven-verify-dependencies:
21           build-timeout: 180
22
23 - job-template:
24     name: '{project-name}-integration-{stream}'
25
26     ######################
27     # Default parameters #
28     ######################
29
30     mvn-goals: clean install
31
32     #####################
33     # Job Configuration #
34     #####################
35
36     project-type: freestyle
37     node: '{build-node}'
38     jdk: '{jdk}'
39
40     properties:
41       - opendaylight-infra-properties:
42           build-days-to-keep: '{build-days-to-keep}'
43
44     parameters:
45       - opendaylight-infra-parameters:
46           os-cloud: '{os-cloud}'
47           project: '{project}'
48           branch: '{branch}'
49           refspec: 'refs/heads/{branch}'
50           artifacts: '{archive-artifacts}'
51
52     scm:
53       - git-scm:
54           refspec: ''
55           branch: '{branch}'
56
57     wrappers:
58       - opendaylight-infra-wrappers:
59           build-timeout: '{build-timeout}'
60
61     triggers:
62       - reverse:
63           jobs: '{dependencies}'
64           result: 'success'
65
66     builders:
67       - jacoco-nojava-workaround
68       - provide-maven-settings:
69           global-settings-file: 'global-settings'
70           settings-file: '{mvn-settings}'
71       - maven-target:
72           maven-version: 'mvn33'
73           goals: |
74               {mvn-goals}
75               {opendaylight-infra-mvn-opts}
76           java-opts:
77             - '{mvn-opts}'
78           settings: '{mvn-settings}'
79           settings-type: cfp
80           global-settings: 'global-settings'
81           global-settings-type: cfp
82
83     publishers:
84       - email-notification:
85           email-recipients: '{email-recipients}'
86           email-prefix: '{email-upstream}'
87       - findbugs
88       - lf-jacoco-report
89       - lf-infra-publish
90
91 - job-template:
92     name: '{project-name}-merge-{stream}'
93
94     ######################
95     # Default parameters #
96     ######################
97
98     java-version: openjdk8
99
100     #####################
101     # Job Configuration #
102     #####################
103
104     # Need to keep jobs that deploy to Nexus at end of build as Maven
105     # projects. Maybe reconsider this once upstream moves deploy to a
106     # separate lifecycle:
107     #     https://issues.apache.org/jira/browse/MNG-5666
108     project-type: maven
109     node: '{build-node}'
110     jdk: '{java-version}'
111
112     properties:
113       - opendaylight-infra-properties:
114           build-days-to-keep: 14
115
116     parameters:
117       - opendaylight-infra-parameters:
118           os-cloud: '{os-cloud}'
119           project: '{project}'
120           branch: '{branch}'
121           refspec: 'refs/heads/{branch}'
122           artifacts: '{archive-artifacts}'
123       - string:
124           name: STREAM
125           default: '{stream}'
126           description: "String representing release name"
127
128     scm:
129       - gerrit-trigger-scm:
130           refspec: ''
131           choosing-strategy: 'default'
132
133     wrappers:
134       - opendaylight-infra-wrappers:
135           build-timeout: '{build-timeout}'
136
137     triggers:
138       - timed: 'H H * * 0'
139       - gerrit-trigger-patch-merged:
140           gerrit-server-name: '{gerrit-server-name}'
141           name: '{project}'
142           branch: '{branch}'
143
144     prebuilders:
145       - jacoco-nojava-workaround
146       - provide-maven-settings:
147           global-settings-file: 'global-settings'
148           settings-file: '{mvn-settings}'
149
150     # TODO: Do we want to apply sophisticated checks as in *-distribution-check-*?
151     maven:
152       maven-name: 'mvn33'
153       goals: >
154           {mvn-goals}
155           -Dmerge
156           -Dstream={stream}
157           {opendaylight-infra-mvn-opts}
158       maven-opts: '{mvn-opts}'
159       settings: '{mvn-settings}'
160       settings-type: cfp
161       global-settings: 'global-settings'
162       global-settings-type: cfp
163       post-step-run-condition: UNSTABLE
164
165     postbuilders:
166       - conditional-step:
167           condition-kind: file-exists
168           condition-filename: deploy-site.xml
169           condition-basedir: workspace
170
171           # The strategy here is intentional to run Maven site:deploy twice
172           # once using regular pom.xml to produce a staged-site which is
173           # then used by deploy-site.xml to push to Nexus. This is a
174           # workaround to Maven Site's default linking code which creates
175           # incorrect URLs for sites due to auto-detection assuming your
176           # project is configured in a certain way which ODL is not.
177           steps:
178             - maven-target:
179                 maven-version: 'mvn33'
180                 pom: pom.xml
181                 goals: 'site:deploy -V -B -Dstream={stream}'
182                 java-opts:
183                   - '-Xmx2g'
184                 settings: '{mvn-settings}'
185                 settings-type: cfp
186                 global-settings: 'global-settings'
187                 global-settings-type: cfp
188             - opendaylight-infra-deploy-maven-site:
189                 settings-file: '{mvn-settings}'
190
191     reporters:
192       - findbugs
193
194     publishers:
195       - email-notification:
196           email-recipients: '{email-recipients}'
197           email-prefix: '[{project-name}]'
198       - maven-deploy:
199           id: ''
200           unique-version: true
201           deploy-unstable: false
202       - lf-jacoco-report
203       - lf-infra-publish
204       - trigger:
205           project: 'distribution-merge-{stream}'
206           threshold: SUCCESS