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