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