Add step to grab csit test status and archive it
[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: '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: '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       - lf-infra-publish
69
70
71 - job-template:
72     name: '{project-name}-publish-p2repo'
73
74     # Job template for publishing a p2 repo given a URL to a zipped p2repo.
75
76     project-type: freestyle
77     node: '{build-node}'
78     jdk: '{jdk}'
79
80     parameters:
81       - opendaylight-infra-parameters:
82           os-cloud: '{os-cloud}'
83           project: '{project}'
84           branch: '{branch}'
85           refspec: 'refs/heads/{branch}'
86           artifacts: '{archive-artifacts}'
87       - p2zip-parameter
88
89     wrappers:
90       - opendaylight-infra-wrappers:
91           build-timeout: '{build-timeout}'
92
93     builders:
94       - wipe-org-opendaylight-repo
95       - jacoco-nojava-workaround
96       - releng-fetch-p2zip-if-necessary:
97           maven-version: 'mvn33'
98           settings: '{mvn-settings}'
99           global-settings: 'global-settings'
100       - releng-generate-p2pom
101       - maven-target:
102           maven-version: 'mvn33'
103           pom: 'pom.xml'
104           goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
105           settings: '{mvn-settings}'
106           settings-type: cfp
107           global-settings: 'global-settings'
108           global-settings-type: cfp
109       - releng-update-p2composite-metadata:
110           maven-version: 'mvn33'
111           settings: '{mvn-settings}'
112           global-settings: 'global-settings'
113
114     publishers:
115       - email-notification:
116           email-recipients: '{email-recipients}'
117           email-prefix: '[releng]'
118       - lf-infra-publish
119
120 # Generic tox-based verify action
121
122 - tox_builder_verify: &tox_builder_verify
123     name: tox_builder_verify
124
125     # Required Variables:
126     #     branch:    git branch (eg. stable/boron or master)
127     #     toxdir:    directory containing the project's tox.ini relative to
128     #                the workspace. Empty works if tox.ini is at project root.
129     # Note that stream value is not needed.
130
131     project-type: freestyle
132     node: '{build-node}'
133     concurrent: true
134
135     properties:
136       - opendaylight-infra-properties:
137           build-days-to-keep: 7
138
139     parameters:
140       - opendaylight-infra-parameters:
141           os-cloud: '{os-cloud}'
142           project: '{project}'
143           branch: '{branch}'
144           refspec: 'refs/heads/{branch}'
145           artifacts: '{archive-artifacts}'
146
147     scm:
148       - git:
149           credentials-id: 'opendaylight-jenkins-ssh'
150           url: '$GIT_BASE'
151           basedir: 'repo'
152           refspec: '$GERRIT_REFSPEC'
153           branches:
154             - 'origin/$GERRIT_BRANCH'
155           skip-tag: true
156           choosing-strategy: 'gerrit'
157           submodule:
158             recursive: true
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           PYTHON="$WORKSPACE/venv-tox/bin/python"
176           $PYTHON -m pip install --upgrade pip
177           $PYTHON -m pip install --upgrade tox argparse
178           $PYTHON -m pip freeze
179           cd $WORKSPACE/repo/{toxdir}
180           tox
181
182     publishers:
183       - email-notification:
184           email-recipients: '{email-recipients}'
185           email-prefix: '[{project}]'
186       - lf-infra-publish
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     build-node: centos7-java-builder-2c-4g
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     build-node: centos7-java-builder-2c-4g
223     branch: master
224
225     <<: *tox_builder_verify
226
227 # Python (pep8) specific, project should migrate to {project-name}-verify-tox-{stream}
228
229 - job-template:
230     name: '{project-name}-verify-python-{stream}'
231
232     # Job template for python verify jobs
233     #
234     # The purpose of this job template is to run tox for projects using this
235     # template.
236     #
237     # Required Variables:
238     #     stream:    release stream (eg. stable-lithium or beryllium)
239     #     branch:    git branch (eg. stable/lithium or master)
240     #     toxdir:    directory containing the project's tox.ini relative to
241     #                the workspace. Empty works if tox.ini is at project root.
242
243     build-node: centos7-java-builder-2c-4g
244
245     <<: *tox_builder_verify
246
247 - job-template:
248     name: '{project-name}-merge-rtd-{stream}'
249     # Template for ReadTheDocs triggering
250
251     project-type: freestyle
252     node: '{build-node}'
253     concurrent: false
254
255     parameters:
256       - opendaylight-infra-parameters:
257           os-cloud: '{os-cloud}'
258           project: '{project}'
259           branch: '{branch}'
260           refspec: 'refs/heads/{branch}'
261           artifacts: '{archive-artifacts}'
262
263     wrappers:
264       - opendaylight-infra-wrappers:
265           build-timeout: '{build-timeout}'
266
267     triggers:
268       - gerrit-trigger-patch-merged:
269           server-name: '{server-name}'
270           name: '{project}'
271           branch: '{branch}'
272
273     builders:
274       - shell: |
275           curl -X POST https://readthedocs.org/build/{rtdproject}
276
277     publishers:
278       - email-notification:
279           email-recipients: '{email-recipients}'
280           email-prefix: '[{project}]'
281       - lf-infra-publish
282
283 # Node related
284
285 - job-template:
286     name: '{project-name}-verify-node-{stream}'
287
288     # Job template for python verify jobs
289     #
290     # The purpose of this job template is to run node tests for projects using
291     # this template. It uses python virtualenv to install nodeenv and create a
292     # virtualenv for nodejs.
293     #
294     # Required Variables:
295     #     stream:    release stream (eg. boron or carbon)
296     #     branch:    git branch (eg. stable/boron or master)
297     #     nodedir:   directory of nodejs project to run node test against
298     #     nodever:   version of node to install in virtualenv
299
300     project-type: freestyle
301     node: '{build-node}'
302     concurrent: true
303
304     properties:
305       - opendaylight-infra-properties:
306           build-days-to-keep: 7
307
308     parameters:
309       - opendaylight-infra-parameters:
310           os-cloud: '{os-cloud}'
311           project: '{project}'
312           branch: '{branch}'
313           refspec: 'refs/heads/{branch}'
314           artifacts: '{archive-artifacts}'
315
316     scm:
317       - git:
318           credentials-id: 'opendaylight-jenkins-ssh'
319           url: '$GIT_BASE'
320           basedir: 'repo'
321           refspec: '$GERRIT_REFSPEC'
322           branches:
323             - 'origin/$GERRIT_BRANCH'
324           skip-tag: true
325           choosing-strategy: 'gerrit'
326
327     wrappers:
328       - opendaylight-infra-wrappers:
329           build-timeout: '{build-timeout}'
330
331     triggers:
332       - gerrit-trigger-patch-submitted:
333           server: '{server-name}'
334           project: '{project}'
335           branch: '{branch}'
336           files: '{nodedir}/**'
337
338     builders:
339       - shell: |
340           #!/bin/bash
341           # Prepare Python
342           virtualenv $WORKSPACE/venv-python
343           source $WORKSPACE/venv-python/bin/activate
344           PYTHON="$WORKSPACE/venv-python/bin/python"
345           $PYTHON -m pip install --upgrade pip
346           $PYTHON -m pip install --upgrade tox argparse nodeenv
347           $PYTHON -m pip freeze
348
349           # Prepare node
350           nodeenv --node={nodever} --prebuilt $WORKSPACE/venv-node
351           source $WORKSPACE/venv-node/bin/activate
352           cd $WORKSPACE/repo/{nodedir}
353           npm install
354           npm test
355
356     publishers:
357       - email-notification:
358           email-recipients: '{email-recipients}'
359           email-prefix: '[{project}]'
360       - lf-infra-publish