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