refactor email recipients to parameter with default value
[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: 'OpenDaylight'
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             name: '{project}'
249             branch: '{branch}'
250
251     builders:
252         - shell: |
253             curl -X POST https://readthedocs.org/build/{rtdproject}
254
255     publishers:
256         - email-notification:
257             email-recipients: '{email-recipients}'
258             email-prefix: '[{project}]'
259         - opendaylight-infra-shiplogs:
260             maven-version: 'mvn33'
261
262 # Node related
263
264 - job-template:
265     name: '{project-name}-verify-node-{stream}'
266
267     # Job template for python verify jobs
268     #
269     # The purpose of this job template is to run node tests for projects using
270     # this template. It uses python virtualenv to install nodeenv and create a
271     # virtualenv for nodejs.
272     #
273     # Required Variables:
274     #     stream:    release stream (eg. boron or carbon)
275     #     branch:    git branch (eg. stable/boron or master)
276     #     nodedir:   directory of nodejs project to run node test against
277     #     nodever:   version of node to install in virtualenv
278
279     project-type: freestyle
280     node: '{build-node}'
281     concurrent: true
282
283     logrotate:
284         daysToKeep: '7'
285         numToKeep: '-1'
286         artifactDaysToKeep: '-1'
287         artifactNumToKeep: '-1'
288
289     parameters:
290         - opendaylight-infra-parameters:
291             project: '{project}'
292             branch: '{branch}'
293             refspec: 'refs/heads/{branch}'
294             artifacts: '{archive-artifacts}'
295
296     scm:
297         - git:
298             credentials-id: 'opendaylight-jenkins-ssh'
299             url: '$GIT_BASE'
300             basedir: 'repo'
301             refspec: '$GERRIT_REFSPEC'
302             branches:
303                 - 'origin/$GERRIT_BRANCH'
304             skip-tag: true
305             choosing-strategy: 'gerrit'
306
307     wrappers:
308         - opendaylight-infra-wrappers:
309             build-timeout: '{build-timeout}'
310
311     triggers:
312         - gerrit:
313             server-name: 'OpenDaylight'
314             trigger-on:
315                 - patchset-created-event:
316                     exclude-drafts: 'true'
317                     exclude-trivial-rebase: 'false'
318                     exclude-no-code-change: 'true'
319                 - draft-published-event
320                 - comment-added-contains-event:
321                     comment-contains-value: 'recheck'
322                 - comment-added-contains-event:
323                     comment-contains-value: 'renode'
324             projects:
325               - project-compare-type: 'ANT'
326                 project-pattern: '{project}'
327                 branches:
328                   - branch-compare-type: 'ANT'
329                     branch-pattern: '**/{branch}'
330                 file-paths:
331                     - compare-type: ANT
332                       pattern: '{nodedir}/**'
333
334     builders:
335         - shell: |
336             #!/bin/bash
337             # Prepare Python
338             virtualenv $WORKSPACE/venv-python
339             source $WORKSPACE/venv-python/bin/activate
340             pip install --upgrade pip
341             pip install --upgrade tox argparse nodeenv
342             pip freeze
343
344             # Prepare node
345             nodeenv --node={nodever} --prebuilt $WORKSPACE/venv-node
346             source $WORKSPACE/venv-node/bin/activate
347             cd $WORKSPACE/repo/{nodedir}
348             npm install
349             npm test
350
351     publishers:
352         - email-notification:
353             email-recipients: '{email-recipients}'
354             email-prefix: '[{project}]'
355         - opendaylight-infra-shiplogs:
356             maven-version: 'mvn33'