Add Support to collect the openstack logs after tests
[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: maven
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     prebuilders:
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
45     maven:
46         maven-name: '{mvn33}'
47         root-pom: 'pom.xml'
48         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'
49         maven-opts: '-Xmx1024m -XX:MaxPermSize=256m'
50         settings: 'autorelease-settings'
51         settings-type: cfp
52         global-settings: 'odl-global-settings'
53         global-settings-type: cfp
54         post-step-run-condition: UNSTABLE
55
56     postbuilders:
57         - releng-stage-release
58
59     publishers:
60         - email-notification:
61             email-prefix: '[releng]'
62         - opendaylight-infra-shiplogs:
63             maven-version: '{mvn33}'
64
65
66 - job-template:
67     name: '{project-name}-publish-p2repo'
68
69     # Job template for publishing a p2 repo given a URL to a zipped p2repo.
70
71     project-type: maven
72     node: '{build-node}'
73     jdk: '{jdk}'
74
75     parameters:
76         - opendaylight-infra-parameters:
77             project: '{project}'
78             branch: '{branch}'
79             refspec: 'refs/heads/{branch}'
80             artifacts: '{archive-artifacts}'
81         - p2zip-parameter
82
83     wrappers:
84         - opendaylight-infra-wrappers:
85             build-timeout: '{build-timeout}'
86
87     prebuilders:
88         - wipe-org-opendaylight-repo
89         - jacoco-nojava-workaround
90         - releng-fetch-p2zip-if-necessary:
91             maven-version: '{mvn33}'
92             settings: '{mvn-settings}'
93             global-settings: 'odl-global-settings'
94         - releng-generate-p2pom
95
96     maven:
97         maven-name: '{mvn33}'
98         root-pom: 'pom.xml'
99         goals: 'clean deploy -V -B -Dmaven.repo.local=/tmp/r'
100         settings: '{mvn-settings}'
101         global-settings: 'odl-global-settings'
102         post-step-run-condition: UNSTABLE
103
104     postbuilders:
105         - releng-update-p2composite-metadata:
106             maven-version: '{mvn33}'
107             settings: '{mvn-settings}'
108             global-settings: 'odl-global-settings'
109
110     publishers:
111         - email-notification:
112             email-prefix: '[releng]'
113         - opendaylight-infra-shiplogs:
114             maven-version: '{mvn33}'
115
116 # Python Related
117
118 - job-template:
119     name: '{project-name}-verify-python-{stream}'
120
121     # Job template for python verify jobs
122     #
123     # The purpose of this job template is to run tox for projects using this
124     # template.
125     #
126     # Required Variables:
127     #     stream:    release stream (eg. stable-lithium or beryllium)
128     #     branch:    git branch (eg. stable/lithium 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
132     project-type: freestyle
133     node: '{build-node}'
134     concurrent: true
135
136     logrotate:
137         daysToKeep: '7'
138         numToKeep: '-1'
139         artifactDaysToKeep: '-1'
140         artifactNumToKeep: '-1'
141
142     parameters:
143         - opendaylight-infra-parameters:
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
160     wrappers:
161         - opendaylight-infra-wrappers:
162             build-timeout: '{build-timeout}'
163
164     triggers:
165         - gerrit:
166             server-name: 'OpenDaylight'
167             trigger-on:
168                 - patchset-created-event:
169                     exclude-drafts: 'true'
170                     exclude-trivial-rebase: 'false'
171                     exclude-no-code-change: 'true'
172                 - draft-published-event
173                 - comment-added-contains-event:
174                     comment-contains-value: 'recheck'
175                 - comment-added-contains-event:
176                     comment-contains-value: 'reverify'
177             projects:
178               - project-compare-type: 'ANT'
179                 project-pattern: '{project}'
180                 branches:
181                   - branch-compare-type: 'ANT'
182                     branch-pattern: '**/{branch}'
183                 file-paths:
184                     - compare-type: ANT
185                       pattern: '{toxdir}/**'
186
187     builders:
188         - shell: |
189             virtualenv $WORKSPACE/venv-tox
190             source $WORKSPACE/venv-tox/bin/activate
191             pip install --upgrade pip
192             pip install --upgrade tox argparse
193             pip freeze
194             cd $WORKSPACE/repo/{toxdir}
195             tox
196
197     publishers:
198         - email-notification:
199             email-prefix: '[{project}]'
200         - opendaylight-infra-shiplogs:
201             maven-version: '{mvn33}'
202
203 - job-template:
204     name: '{project-name}-merge-rtd-{stream}'
205     # Template for ReadTheDocs triggering
206
207     project-type: freestyle
208     node: '{build-node}'
209     concurrent: false
210
211     parameters:
212         - opendaylight-infra-parameters:
213             project: '{project}'
214             branch: '{branch}'
215             refspec: 'refs/heads/{branch}'
216             artifacts: '{archive-artifacts}'
217
218     wrappers:
219         - opendaylight-infra-wrappers:
220             build-timeout: '{build-timeout}'
221
222     triggers:
223         - gerrit-trigger-patch-merged:
224             name: '{project}'
225             branch: '{branch}'
226
227     builders:
228         - shell: |
229             curl -X POST https://readthedocs.org/build/{rtdproject}
230
231     publishers:
232         - email-notification:
233             email-prefix: '[{project}]'
234         - opendaylight-infra-shiplogs:
235             maven-version: '{mvn33}'
236
237 # Node related
238
239 - job-template:
240     name: '{project-name}-verify-node-{stream}'
241
242     # Job template for python verify jobs
243     #
244     # The purpose of this job template is to run node tests for projects using
245     # this template. It uses python virtualenv to install nodeenv and create a
246     # virtualenv for nodejs.
247     #
248     # Required Variables:
249     #     stream:    release stream (eg. stable-lithium or beryllium)
250     #     branch:    git branch (eg. stable/lithium or master)
251     #     nodedir:   directory of nodejs project to run node test against
252     #     nodever:   version of node to install in virtualenv
253
254     project-type: freestyle
255     node: '{build-node}'
256     concurrent: true
257
258     logrotate:
259         daysToKeep: '7'
260         numToKeep: '-1'
261         artifactDaysToKeep: '-1'
262         artifactNumToKeep: '-1'
263
264     parameters:
265         - opendaylight-infra-parameters:
266             project: '{project}'
267             branch: '{branch}'
268             refspec: 'refs/heads/{branch}'
269             artifacts: '{archive-artifacts}'
270
271     scm:
272         - git:
273             credentials-id: 'opendaylight-jenkins-ssh'
274             url: '$GIT_BASE'
275             basedir: 'repo'
276             refspec: '$GERRIT_REFSPEC'
277             branches:
278                 - 'origin/$GERRIT_BRANCH'
279             skip-tag: true
280             choosing-strategy: 'gerrit'
281
282     wrappers:
283         - opendaylight-infra-wrappers:
284             build-timeout: '{build-timeout}'
285
286     triggers:
287         - gerrit:
288             server-name: 'OpenDaylight'
289             trigger-on:
290                 - patchset-created-event:
291                     exclude-drafts: 'true'
292                     exclude-trivial-rebase: 'false'
293                     exclude-no-code-change: 'true'
294                 - draft-published-event
295                 - comment-added-contains-event:
296                     comment-contains-value: 'recheck'
297                 - comment-added-contains-event:
298                     comment-contains-value: 'reverify'
299             projects:
300               - project-compare-type: 'ANT'
301                 project-pattern: '{project}'
302                 branches:
303                   - branch-compare-type: 'ANT'
304                     branch-pattern: '**/{branch}'
305                 file-paths:
306                     - compare-type: ANT
307                       pattern: '{nodedir}/**'
308
309     builders:
310         - shell: |
311             #!/bin/bash
312             # Prepare Python
313             virtualenv $WORKSPACE/venv-python
314             source $WORKSPACE/venv-python/bin/activate
315             pip install --upgrade pip
316             pip install --upgrade tox argparse nodeenv
317             pip freeze
318
319             # Prepare node
320             nodeenv --node={nodever} --prebuilt $WORKSPACE/venv-node
321             source $WORKSPACE/venv-node/bin/activate
322             cd $WORKSPACE/repo/{nodedir}
323             npm install
324             npm test
325
326     publishers:
327         - email-notification:
328             email-prefix: '[{project}]'
329         - opendaylight-infra-shiplogs:
330             maven-version: '{mvn33}'