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