Merge "fix L3 regression for new-netvirt CSIT with stable/mitaka"
[releng/builder.git] / jjb / releng-templates.yaml
1 - job-template:
2     name: '{project-name}-release-java'
3
4     # Job template for producing a release candidate by creating a staging repo
5     # in Nexus.
6
7     project-type: freestyle
8     node: '{build-node}'
9     jdk: '{jdk}'
10
11     logrotate:
12         daysToKeep: '30'
13
14     parameters:
15         - opendaylight-infra-parameters:
16             project: '{project}'
17             branch: '{branch}'
18             refspec: 'refs/heads/{branch}'
19             artifacts: '{archive-artifacts}'
20         - build-tag
21         - stage-id-parameter:
22             stage-id: '{stage-id}'
23
24     scm:
25         - git:
26             credentials-id: 'opendaylight-jenkins-ssh'
27             url: '$GIT_BASE'
28             branches:
29                 - '$BUILD_TAG'
30             skip-tag: true
31             shallow-clone: true
32             wipe-workspace: true
33
34     wrappers:
35         - opendaylight-infra-wrappers:
36             build-timeout: '{build-timeout}'
37
38     builders:
39         - wipe-org-opendaylight-repo
40         - jacoco-nojava-workaround
41         - provide-maven-settings:
42             global-settings-file: 'odl-global-settings'
43             settings-file: 'autorelease-settings'
44         - maven-target:
45             maven-version: 'mvn33'
46             pom: 'pom.xml'
47             goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r -Djenkins -DaltDeploymentRepository=staging::default::file:hide/from/pom/files/stage'
48             java-opts:
49               - '-Xmx1024m -XX:MaxPermSize=256m'
50             settings: 'autorelease-settings'
51             settings-type: cfp
52             global-settings: 'odl-global-settings'
53             global-settings-type: cfp
54         - releng-stage-release
55
56     publishers:
57         - email-notification:
58             email-recipients: '{email-recipients}'
59             email-prefix: '[releng]'
60         - opendaylight-infra-shiplogs:
61             maven-version: 'mvn33'
62
63
64 - job-template:
65     name: '{project-name}-publish-p2repo'
66
67     # Job template for publishing a p2 repo given a URL to a zipped p2repo.
68
69     project-type: freestyle
70     node: '{build-node}'
71     jdk: '{jdk}'
72
73     parameters:
74         - opendaylight-infra-parameters:
75             project: '{project}'
76             branch: '{branch}'
77             refspec: 'refs/heads/{branch}'
78             artifacts: '{archive-artifacts}'
79         - p2zip-parameter
80
81     wrappers:
82         - opendaylight-infra-wrappers:
83             build-timeout: '{build-timeout}'
84
85     builders:
86         - wipe-org-opendaylight-repo
87         - jacoco-nojava-workaround
88         - releng-fetch-p2zip-if-necessary:
89             maven-version: 'mvn33'
90             settings: '{mvn-settings}'
91             global-settings: 'odl-global-settings'
92         - releng-generate-p2pom
93         - maven-target:
94             maven-version: 'mvn33'
95             pom: 'pom.xml'
96             goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
97             settings: '{mvn-settings}'
98             settings-type: cfp
99             global-settings: 'odl-global-settings'
100             global-settings-type: cfp
101         - releng-update-p2composite-metadata:
102             maven-version: 'mvn33'
103             settings: '{mvn-settings}'
104             global-settings: 'odl-global-settings'
105
106     publishers:
107         - email-notification:
108             email-recipients: '{email-recipients}'
109             email-prefix: '[releng]'
110         - opendaylight-infra-shiplogs:
111             maven-version: 'mvn33'
112
113 # Generic tox-based verify action
114
115 - tox_builder_verify: &tox_builder_verify
116     name: tox_builder_verify
117
118     # Required Variables:
119     #     stream:    release stream (eg. boron or carbon)
120     #     branch:    git branch (eg. stable/boron or master)
121     #     toxdir:    directory containing the project's tox.ini relative to
122     #                the workspace. Empty works if tox.ini is at project root.
123
124     project-type: freestyle
125     node: '{build-node}'
126     concurrent: true
127
128     logrotate:
129         daysToKeep: '7'
130
131     parameters:
132         - opendaylight-infra-parameters:
133             project: '{project}'
134             branch: '{branch}'
135             refspec: 'refs/heads/{branch}'
136             artifacts: '{archive-artifacts}'
137
138     scm:
139         - git:
140             credentials-id: 'opendaylight-jenkins-ssh'
141             url: '$GIT_BASE'
142             basedir: 'repo'
143             refspec: '$GERRIT_REFSPEC'
144             branches:
145                 - 'origin/$GERRIT_BRANCH'
146             skip-tag: true
147             choosing-strategy: 'gerrit'
148
149     wrappers:
150         - opendaylight-infra-wrappers:
151             build-timeout: '{build-timeout}'
152
153     triggers:
154         - gerrit:
155             server-name: '{server-name}'
156             trigger-on:
157                 - patchset-created-event:
158                     exclude-drafts: 'true'
159                     exclude-trivial-rebase: 'false'
160                     exclude-no-code-change: 'true'
161                 - draft-published-event
162                 - comment-added-contains-event:
163                     comment-contains-value: 'recheck'
164                 - comment-added-contains-event:
165                     comment-contains-value: 'retox'
166             projects:
167               - project-compare-type: 'ANT'
168                 project-pattern: '{project}'
169                 branches:
170                   - branch-compare-type: 'ANT'
171                     branch-pattern: '**/{branch}'
172                 file-paths:
173                     - compare-type: ANT
174                       pattern: '{toxdir}/**'
175
176     builders:
177         - shell: |
178             virtualenv $WORKSPACE/venv-tox
179             source $WORKSPACE/venv-tox/bin/activate
180             pip install --upgrade pip
181             pip install --upgrade tox argparse
182             pip freeze
183             cd $WORKSPACE/repo/{toxdir}
184             tox
185
186     publishers:
187         - email-notification:
188             email-recipients: '{email-recipients}'
189             email-prefix: '[{project}]'
190         - opendaylight-infra-shiplogs:
191             maven-version: 'mvn33'
192
193 - job-template:
194     name: '{project-name}-verify-tox-{stream}'
195
196     # Job template for verify jobs executing tox envlist
197     #
198     # The purpose of this job template is to run tox for projects using this
199     # template.
200     #
201     # Required Variables:
202     #     stream:    release stream (eg. stable-lithium or beryllium)
203     #     branch:    git branch (eg. stable/lithium or master)
204     #     toxdir:    directory containing the project's tox.ini relative to
205     #                the workspace. Empty works if tox.ini is at project root.
206
207     <<: *tox_builder_verify
208
209 # Python (pep8) specific, project should migrate to {project-name}-verify-tox-{stream}
210
211 - job-template:
212     name: '{project-name}-verify-python-{stream}'
213
214     # Job template for python verify jobs
215     #
216     # The purpose of this job template is to run tox for projects using this
217     # template.
218     #
219     # Required Variables:
220     #     stream:    release stream (eg. stable-lithium or beryllium)
221     #     branch:    git branch (eg. stable/lithium or master)
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     <<: *tox_builder_verify
226
227 - job-template:
228     name: '{project-name}-merge-rtd-{stream}'
229     # Template for ReadTheDocs triggering
230
231     project-type: freestyle
232     node: '{build-node}'
233     concurrent: false
234
235     parameters:
236         - opendaylight-infra-parameters:
237             project: '{project}'
238             branch: '{branch}'
239             refspec: 'refs/heads/{branch}'
240             artifacts: '{archive-artifacts}'
241
242     wrappers:
243         - opendaylight-infra-wrappers:
244             build-timeout: '{build-timeout}'
245
246     triggers:
247         - gerrit-trigger-patch-merged:
248             server-name: '{server-name}'
249             name: '{project}'
250             branch: '{branch}'
251
252     builders:
253         - shell: |
254             curl -X POST https://readthedocs.org/build/{rtdproject}
255
256     publishers:
257         - email-notification:
258             email-recipients: '{email-recipients}'
259             email-prefix: '[{project}]'
260         - opendaylight-infra-shiplogs:
261             maven-version: 'mvn33'
262
263 # Node related
264
265 - job-template:
266     name: '{project-name}-verify-node-{stream}'
267
268     # Job template for python verify jobs
269     #
270     # The purpose of this job template is to run node tests for projects using
271     # this template. It uses python virtualenv to install nodeenv and create a
272     # virtualenv for nodejs.
273     #
274     # Required Variables:
275     #     stream:    release stream (eg. boron or carbon)
276     #     branch:    git branch (eg. stable/boron or master)
277     #     nodedir:   directory of nodejs project to run node test against
278     #     nodever:   version of node to install in virtualenv
279
280     project-type: freestyle
281     node: '{build-node}'
282     concurrent: true
283
284     logrotate:
285         daysToKeep: '7'
286         numToKeep: '-1'
287         artifactDaysToKeep: '-1'
288         artifactNumToKeep: '-1'
289
290     parameters:
291         - opendaylight-infra-parameters:
292             project: '{project}'
293             branch: '{branch}'
294             refspec: 'refs/heads/{branch}'
295             artifacts: '{archive-artifacts}'
296
297     scm:
298         - git:
299             credentials-id: 'opendaylight-jenkins-ssh'
300             url: '$GIT_BASE'
301             basedir: 'repo'
302             refspec: '$GERRIT_REFSPEC'
303             branches:
304                 - 'origin/$GERRIT_BRANCH'
305             skip-tag: true
306             choosing-strategy: 'gerrit'
307
308     wrappers:
309         - opendaylight-infra-wrappers:
310             build-timeout: '{build-timeout}'
311
312     triggers:
313         - gerrit:
314             server-name: '{server-name}'
315             trigger-on:
316                 - patchset-created-event:
317                     exclude-drafts: 'true'
318                     exclude-trivial-rebase: 'false'
319                     exclude-no-code-change: 'true'
320                 - draft-published-event
321                 - comment-added-contains-event:
322                     comment-contains-value: 'recheck'
323                 - comment-added-contains-event:
324                     comment-contains-value: 'renode'
325             projects:
326               - project-compare-type: 'ANT'
327                 project-pattern: '{project}'
328                 branches:
329                   - branch-compare-type: 'ANT'
330                     branch-pattern: '**/{branch}'
331                 file-paths:
332                     - compare-type: ANT
333                       pattern: '{nodedir}/**'
334
335     builders:
336         - shell: |
337             #!/bin/bash
338             # Prepare Python
339             virtualenv $WORKSPACE/venv-python
340             source $WORKSPACE/venv-python/bin/activate
341             pip install --upgrade pip
342             pip install --upgrade tox argparse nodeenv
343             pip freeze
344
345             # Prepare node
346             nodeenv --node={nodever} --prebuilt $WORKSPACE/venv-node
347             source $WORKSPACE/venv-node/bin/activate
348             cd $WORKSPACE/repo/{nodedir}
349             npm install
350             npm test
351
352     publishers:
353         - email-notification:
354             email-recipients: '{email-recipients}'
355             email-prefix: '[{project}]'
356         - opendaylight-infra-shiplogs:
357             maven-version: 'mvn33'