802448ceab75de9fbb9046c7dd0f7e973895463a
[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           submodule:
160             recursive: true
161
162     wrappers:
163       - opendaylight-infra-wrappers:
164           build-timeout: '{build-timeout}'
165
166     triggers:
167       - gerrit-trigger-patch-submitted:
168           server: '{server-name}'
169           project: '{project}'
170           branch: '{branch}'
171           files: '{toxdir}/**'
172
173     builders:
174       - shell: |
175           virtualenv $WORKSPACE/venv-tox
176           source $WORKSPACE/venv-tox/bin/activate
177           pip install --upgrade pip
178           pip install --upgrade tox argparse
179           pip freeze
180           cd $WORKSPACE/repo/{toxdir}
181           tox
182
183     publishers:
184       - email-notification:
185           email-recipients: '{email-recipients}'
186           email-prefix: '[{project}]'
187       - opendaylight-infra-shiplogs:
188           maven-version: 'mvn33'
189
190 - job-template:
191     name: '{project-name}-verify-tox-{stream}'
192
193     # Job template for verify jobs executing tox envlist
194     #
195     # The purpose of this job template is to run tox for projects using this
196     # template.
197     #
198     # Required Variables:
199     #     stream:    release stream (eg. stable-lithium or beryllium)
200     #     branch:    git branch (eg. stable/lithium or master)
201     #     toxdir:    directory containing the project's tox.ini relative to
202     #                the workspace. Empty works if tox.ini is at project root.
203
204     <<: *tox_builder_verify
205
206 # Specification for projects outside release cycle, to avoid referring a stream.
207 # This is useful mailny for integration-test-jobs, which defines streams for Integration/Distribution,
208 # but the tox job is related to Integration/Test only.
209
210 - job-template:
211     name: '{project-name}-verify-tox-master'
212
213     # Job template for verify jobs executing tox envlist
214     #
215     # The purpose of this job template is to run tox for projects using this
216     # template.
217     #
218     # Required Variables:
219     #     toxdir:    directory containing the project's tox.ini relative to
220     #                the workspace. Empty works if tox.ini is at project root.
221
222     branch: master
223
224     <<: *tox_builder_verify
225
226 # Python (pep8) specific, project should migrate to {project-name}-verify-tox-{stream}
227
228 - job-template:
229     name: '{project-name}-verify-python-{stream}'
230
231     # Job template for python verify jobs
232     #
233     # The purpose of this job template is to run tox for projects using this
234     # template.
235     #
236     # Required Variables:
237     #     stream:    release stream (eg. stable-lithium or beryllium)
238     #     branch:    git branch (eg. stable/lithium or master)
239     #     toxdir:    directory containing the project's tox.ini relative to
240     #                the workspace. Empty works if tox.ini is at project root.
241
242     <<: *tox_builder_verify
243
244 - job-template:
245     name: '{project-name}-merge-rtd-{stream}'
246     # Template for ReadTheDocs triggering
247
248     project-type: freestyle
249     node: '{build-node}'
250     concurrent: false
251
252     parameters:
253       - opendaylight-infra-parameters:
254           os-cloud: '{os-cloud}'
255           project: '{project}'
256           branch: '{branch}'
257           refspec: 'refs/heads/{branch}'
258           artifacts: '{archive-artifacts}'
259
260     wrappers:
261       - opendaylight-infra-wrappers:
262           build-timeout: '{build-timeout}'
263
264     triggers:
265       - gerrit-trigger-patch-merged:
266           server-name: '{server-name}'
267           name: '{project}'
268           branch: '{branch}'
269
270     builders:
271       - shell: |
272           curl -X POST https://readthedocs.org/build/{rtdproject}
273
274     publishers:
275       - email-notification:
276           email-recipients: '{email-recipients}'
277           email-prefix: '[{project}]'
278       - opendaylight-infra-shiplogs:
279           maven-version: 'mvn33'
280
281 # Node related
282
283 - job-template:
284     name: '{project-name}-verify-node-{stream}'
285
286     # Job template for python verify jobs
287     #
288     # The purpose of this job template is to run node tests for projects using
289     # this template. It uses python virtualenv to install nodeenv and create a
290     # virtualenv for nodejs.
291     #
292     # Required Variables:
293     #     stream:    release stream (eg. boron or carbon)
294     #     branch:    git branch (eg. stable/boron or master)
295     #     nodedir:   directory of nodejs project to run node test against
296     #     nodever:   version of node to install in virtualenv
297
298     project-type: freestyle
299     node: '{build-node}'
300     concurrent: true
301
302     properties:
303       - opendaylight-infra-properties:
304           build-days-to-keep: 7
305
306     parameters:
307       - opendaylight-infra-parameters:
308           os-cloud: '{os-cloud}'
309           project: '{project}'
310           branch: '{branch}'
311           refspec: 'refs/heads/{branch}'
312           artifacts: '{archive-artifacts}'
313
314     scm:
315       - git:
316           credentials-id: 'opendaylight-jenkins-ssh'
317           url: '$GIT_BASE'
318           basedir: 'repo'
319           refspec: '$GERRIT_REFSPEC'
320           branches:
321             - 'origin/$GERRIT_BRANCH'
322           skip-tag: true
323           choosing-strategy: 'gerrit'
324
325     wrappers:
326       - opendaylight-infra-wrappers:
327           build-timeout: '{build-timeout}'
328
329     triggers:
330       - gerrit-trigger-patch-submitted:
331           server: '{server-name}'
332           project: '{project}'
333           branch: '{branch}'
334           files: '{nodedir}/**'
335
336     builders:
337       - shell: |
338           #!/bin/bash
339           # Prepare Python
340           virtualenv $WORKSPACE/venv-python
341           source $WORKSPACE/venv-python/bin/activate
342           pip install --upgrade pip
343           pip install --upgrade tox argparse nodeenv
344           pip freeze
345
346           # Prepare node
347           nodeenv --node={nodever} --prebuilt $WORKSPACE/venv-node
348           source $WORKSPACE/venv-node/bin/activate
349           cd $WORKSPACE/repo/{nodedir}
350           npm install
351           npm test
352
353     publishers:
354       - email-notification:
355           email-recipients: '{email-recipients}'
356           email-prefix: '[{project}]'
357       - opendaylight-infra-shiplogs:
358           maven-version: 'mvn33'