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