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