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