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