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