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