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