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