Merge "Use OS_CLOUD variable for openstackclient"
[releng/builder.git] / jjb / releng-templates.yaml
1 ---
2 - job-template:
3     name: '{project-name}-release-java'
4
5     # Job template for producing a release candidate by creating a staging repo
6     # in Nexus.
7
8     project-type: freestyle
9     node: '{build-node}'
10     jdk: '{jdk}'
11
12     properties:
13       - opendaylight-infra-properties:
14           build-days-to-keep: 30
15
16     parameters:
17       - opendaylight-infra-parameters:
18           os-cloud: '{os-cloud}'
19           project: '{project}'
20           branch: '{branch}'
21           refspec: 'refs/heads/{branch}'
22           artifacts: '{archive-artifacts}'
23       - build-tag
24       - stage-id-parameter:
25           stage-id: '{stage-id}'
26
27     scm:
28       - git:
29           credentials-id: 'opendaylight-jenkins-ssh'
30           url: '$GIT_BASE'
31           branches:
32             - '$BUILD_TAG'
33           skip-tag: true
34           shallow-clone: true
35           wipe-workspace: true
36
37     wrappers:
38       - opendaylight-infra-wrappers:
39           build-timeout: '{build-timeout}'
40
41     builders:
42       - wipe-org-opendaylight-repo
43       - jacoco-nojava-workaround
44       - provide-maven-settings:
45           global-settings-file: 'odl-global-settings'
46           settings-file: 'autorelease-settings'
47       - maven-target:
48           maven-version: 'mvn33'
49           pom: 'pom.xml'
50           goals: >
51               clean deploy -V -B
52               -Dmaven.repo.local=/tmp/r
53               -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
54               -Djenkins
55               -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage
56           java-opts:
57             - '-Xmx1024m -XX:MaxPermSize=256m'
58           settings: 'autorelease-settings'
59           settings-type: cfp
60           global-settings: 'odl-global-settings'
61           global-settings-type: cfp
62       - releng-stage-release
63
64     publishers:
65       - email-notification:
66           email-recipients: '{email-recipients}'
67           email-prefix: '[releng]'
68       - opendaylight-infra-shiplogs:
69           maven-version: 'mvn33'
70
71
72 - job-template:
73     name: '{project-name}-publish-p2repo'
74
75     # Job template for publishing a p2 repo given a URL to a zipped p2repo.
76
77     project-type: freestyle
78     node: '{build-node}'
79     jdk: '{jdk}'
80
81     parameters:
82       - opendaylight-infra-parameters:
83           os-cloud: '{os-cloud}'
84           project: '{project}'
85           branch: '{branch}'
86           refspec: 'refs/heads/{branch}'
87           artifacts: '{archive-artifacts}'
88       - p2zip-parameter
89
90     wrappers:
91       - opendaylight-infra-wrappers:
92           build-timeout: '{build-timeout}'
93
94     builders:
95       - wipe-org-opendaylight-repo
96       - jacoco-nojava-workaround
97       - releng-fetch-p2zip-if-necessary:
98           maven-version: 'mvn33'
99           settings: '{mvn-settings}'
100           global-settings: 'odl-global-settings'
101       - releng-generate-p2pom
102       - maven-target:
103           maven-version: 'mvn33'
104           pom: 'pom.xml'
105           goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
106           settings: '{mvn-settings}'
107           settings-type: cfp
108           global-settings: 'odl-global-settings'
109           global-settings-type: cfp
110       - releng-update-p2composite-metadata:
111           maven-version: 'mvn33'
112           settings: '{mvn-settings}'
113           global-settings: 'odl-global-settings'
114
115     publishers:
116       - email-notification:
117           email-recipients: '{email-recipients}'
118           email-prefix: '[releng]'
119       - opendaylight-infra-shiplogs:
120           maven-version: 'mvn33'
121
122 # Generic tox-based verify action
123
124 - tox_builder_verify: &tox_builder_verify
125     name: tox_builder_verify
126
127     # Required Variables:
128     #     branch:    git branch (eg. stable/boron or master)
129     #     toxdir:    directory containing the project's tox.ini relative to
130     #                the workspace. Empty works if tox.ini is at project root.
131     # Note that stream value is not needed.
132
133     project-type: freestyle
134     node: '{build-node}'
135     concurrent: true
136
137     properties:
138       - opendaylight-infra-properties:
139           build-days-to-keep: 7
140
141     parameters:
142       - opendaylight-infra-parameters:
143           os-cloud: '{os-cloud}'
144           project: '{project}'
145           branch: '{branch}'
146           refspec: 'refs/heads/{branch}'
147           artifacts: '{archive-artifacts}'
148
149     scm:
150       - git:
151           credentials-id: 'opendaylight-jenkins-ssh'
152           url: '$GIT_BASE'
153           basedir: 'repo'
154           refspec: '$GERRIT_REFSPEC'
155           branches:
156             - 'origin/$GERRIT_BRANCH'
157           skip-tag: true
158           choosing-strategy: 'gerrit'
159
160     wrappers:
161       - opendaylight-infra-wrappers:
162           build-timeout: '{build-timeout}'
163
164     triggers:
165       - gerrit-trigger-patch-submitted:
166           server: '{server-name}'
167           project: '{project}'
168           branch: '{branch}'
169           files: '{toxdir}/**'
170
171     builders:
172       - shell: |
173           virtualenv $WORKSPACE/venv-tox
174           source $WORKSPACE/venv-tox/bin/activate
175           pip install --upgrade pip
176           pip install --upgrade tox argparse
177           pip freeze
178           cd $WORKSPACE/repo/{toxdir}
179           tox
180
181     publishers:
182       - email-notification:
183           email-recipients: '{email-recipients}'
184           email-prefix: '[{project}]'
185       - opendaylight-infra-shiplogs:
186           maven-version: 'mvn33'
187
188 - job-template:
189     name: '{project-name}-verify-tox-{stream}'
190
191     # Job template for verify jobs executing tox envlist
192     #
193     # The purpose of this job template is to run tox for projects using this
194     # template.
195     #
196     # Required Variables:
197     #     stream:    release stream (eg. stable-lithium or beryllium)
198     #     branch:    git branch (eg. stable/lithium or master)
199     #     toxdir:    directory containing the project's tox.ini relative to
200     #                the workspace. Empty works if tox.ini is at project root.
201
202     <<: *tox_builder_verify
203
204 # Specification for projects outside release cycle, to avoid referring a stream.
205 # This is useful mailny for integration-test-jobs, which defines streams for Integration/Distribution,
206 # but the tox job is related to Integration/Test only.
207
208 - job-template:
209     name: '{project-name}-verify-tox-master'
210
211     # Job template for verify jobs executing tox envlist
212     #
213     # The purpose of this job template is to run tox for projects using this
214     # template.
215     #
216     # Required Variables:
217     #     toxdir:    directory containing the project's tox.ini relative to
218     #                the workspace. Empty works if tox.ini is at project root.
219
220     branch: master
221
222     <<: *tox_builder_verify
223
224 # Python (pep8) specific, project should migrate to {project-name}-verify-tox-{stream}
225
226 - job-template:
227     name: '{project-name}-verify-python-{stream}'
228
229     # Job template for python verify jobs
230     #
231     # The purpose of this job template is to run tox for projects using this
232     # template.
233     #
234     # Required Variables:
235     #     stream:    release stream (eg. stable-lithium or beryllium)
236     #     branch:    git branch (eg. stable/lithium or master)
237     #     toxdir:    directory containing the project's tox.ini relative to
238     #                the workspace. Empty works if tox.ini is at project root.
239
240     <<: *tox_builder_verify
241
242 - job-template:
243     name: '{project-name}-merge-rtd-{stream}'
244     # Template for ReadTheDocs triggering
245
246     project-type: freestyle
247     node: '{build-node}'
248     concurrent: false
249
250     parameters:
251       - opendaylight-infra-parameters:
252           os-cloud: '{os-cloud}'
253           project: '{project}'
254           branch: '{branch}'
255           refspec: 'refs/heads/{branch}'
256           artifacts: '{archive-artifacts}'
257
258     wrappers:
259       - opendaylight-infra-wrappers:
260           build-timeout: '{build-timeout}'
261
262     triggers:
263       - gerrit-trigger-patch-merged:
264           server-name: '{server-name}'
265           name: '{project}'
266           branch: '{branch}'
267
268     builders:
269       - shell: |
270           curl -X POST https://readthedocs.org/build/{rtdproject}
271
272     publishers:
273       - email-notification:
274           email-recipients: '{email-recipients}'
275           email-prefix: '[{project}]'
276       - opendaylight-infra-shiplogs:
277           maven-version: 'mvn33'
278
279 # Node related
280
281 - job-template:
282     name: '{project-name}-verify-node-{stream}'
283
284     # Job template for python verify jobs
285     #
286     # The purpose of this job template is to run node tests for projects using
287     # this template. It uses python virtualenv to install nodeenv and create a
288     # virtualenv for nodejs.
289     #
290     # Required Variables:
291     #     stream:    release stream (eg. boron or carbon)
292     #     branch:    git branch (eg. stable/boron or master)
293     #     nodedir:   directory of nodejs project to run node test against
294     #     nodever:   version of node to install in virtualenv
295
296     project-type: freestyle
297     node: '{build-node}'
298     concurrent: true
299
300     properties:
301       - opendaylight-infra-properties:
302           build-days-to-keep: 7
303
304     parameters:
305       - opendaylight-infra-parameters:
306           os-cloud: '{os-cloud}'
307           project: '{project}'
308           branch: '{branch}'
309           refspec: 'refs/heads/{branch}'
310           artifacts: '{archive-artifacts}'
311
312     scm:
313       - git:
314           credentials-id: 'opendaylight-jenkins-ssh'
315           url: '$GIT_BASE'
316           basedir: 'repo'
317           refspec: '$GERRIT_REFSPEC'
318           branches:
319             - 'origin/$GERRIT_BRANCH'
320           skip-tag: true
321           choosing-strategy: 'gerrit'
322
323     wrappers:
324       - opendaylight-infra-wrappers:
325           build-timeout: '{build-timeout}'
326
327     triggers:
328       - gerrit-trigger-patch-submitted:
329           server: '{server-name}'
330           project: '{project}'
331           branch: '{branch}'
332           files: '{nodedir}/**'
333
334     builders:
335       - shell: |
336           #!/bin/bash
337           # Prepare Python
338           virtualenv $WORKSPACE/venv-python
339           source $WORKSPACE/venv-python/bin/activate
340           pip install --upgrade pip
341           pip install --upgrade tox argparse nodeenv
342           pip freeze
343
344           # Prepare node
345           nodeenv --node={nodever} --prebuilt $WORKSPACE/venv-node
346           source $WORKSPACE/venv-node/bin/activate
347           cd $WORKSPACE/repo/{nodedir}
348           npm install
349           npm test
350
351     publishers:
352       - email-notification:
353           email-recipients: '{email-recipients}'
354           email-prefix: '[{project}]'
355       - opendaylight-infra-shiplogs:
356           maven-version: 'mvn33'