Merge "refactor git-url 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-trigger-patch-submitted:
155             server: '{server-name}'
156             project: '{project}'
157             branch: '{branch}'
158             files: '{toxdir}/**'
159
160     builders:
161         - shell: |
162             virtualenv $WORKSPACE/venv-tox
163             source $WORKSPACE/venv-tox/bin/activate
164             pip install --upgrade pip
165             pip install --upgrade tox argparse
166             pip freeze
167             cd $WORKSPACE/repo/{toxdir}
168             tox
169
170     publishers:
171         - email-notification:
172             email-recipients: '{email-recipients}'
173             email-prefix: '[{project}]'
174         - opendaylight-infra-shiplogs:
175             maven-version: 'mvn33'
176
177 - job-template:
178     name: '{project-name}-verify-tox-{stream}'
179
180     # Job template for verify jobs executing tox envlist
181     #
182     # The purpose of this job template is to run tox for projects using this
183     # template.
184     #
185     # Required Variables:
186     #     stream:    release stream (eg. stable-lithium or beryllium)
187     #     branch:    git branch (eg. stable/lithium or master)
188     #     toxdir:    directory containing the project's tox.ini relative to
189     #                the workspace. Empty works if tox.ini is at project root.
190
191     <<: *tox_builder_verify
192
193 # Python (pep8) specific, project should migrate to {project-name}-verify-tox-{stream}
194
195 - job-template:
196     name: '{project-name}-verify-python-{stream}'
197
198     # Job template for python verify jobs
199     #
200     # The purpose of this job template is to run tox for projects using this
201     # template.
202     #
203     # Required Variables:
204     #     stream:    release stream (eg. stable-lithium or beryllium)
205     #     branch:    git branch (eg. stable/lithium or master)
206     #     toxdir:    directory containing the project's tox.ini relative to
207     #                the workspace. Empty works if tox.ini is at project root.
208
209     <<: *tox_builder_verify
210
211 - job-template:
212     name: '{project-name}-merge-rtd-{stream}'
213     # Template for ReadTheDocs triggering
214
215     project-type: freestyle
216     node: '{build-node}'
217     concurrent: false
218
219     parameters:
220         - opendaylight-infra-parameters:
221             project: '{project}'
222             branch: '{branch}'
223             refspec: 'refs/heads/{branch}'
224             artifacts: '{archive-artifacts}'
225
226     wrappers:
227         - opendaylight-infra-wrappers:
228             build-timeout: '{build-timeout}'
229
230     triggers:
231         - gerrit-trigger-patch-merged:
232             server-name: '{server-name}'
233             name: '{project}'
234             branch: '{branch}'
235
236     builders:
237         - shell: |
238             curl -X POST https://readthedocs.org/build/{rtdproject}
239
240     publishers:
241         - email-notification:
242             email-recipients: '{email-recipients}'
243             email-prefix: '[{project}]'
244         - opendaylight-infra-shiplogs:
245             maven-version: 'mvn33'
246
247 # Node related
248
249 - job-template:
250     name: '{project-name}-verify-node-{stream}'
251
252     # Job template for python verify jobs
253     #
254     # The purpose of this job template is to run node tests for projects using
255     # this template. It uses python virtualenv to install nodeenv and create a
256     # virtualenv for nodejs.
257     #
258     # Required Variables:
259     #     stream:    release stream (eg. boron or carbon)
260     #     branch:    git branch (eg. stable/boron or master)
261     #     nodedir:   directory of nodejs project to run node test against
262     #     nodever:   version of node to install in virtualenv
263
264     project-type: freestyle
265     node: '{build-node}'
266     concurrent: true
267
268     logrotate:
269         daysToKeep: '7'
270         numToKeep: '-1'
271         artifactDaysToKeep: '-1'
272         artifactNumToKeep: '-1'
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'