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