Builder job for deploying Openstack for testing
[releng/builder.git] / jjb / integration / integration-macros.yaml
1 - parameter:
2     name: integration-branch
3     parameters:
4         - string:
5             name: BRANCH
6             default: '{branch}'
7             description: 'Distribution GIT branch'
8
9 - parameter:
10     name: integration-bundleurl
11     parameters:
12         - string:
13             name: BUNDLEURL
14             default: '{bundleurl}'
15             description: 'URL to karaf distribution zip'
16
17 - parameter:
18     name: integration-jdk-version
19     parameters:
20         - string:
21             name: JDKVERSION
22             default: '{jdkversion}'
23             description: 'Parameter to indicate JAVA Version'
24
25 - parameter:
26     name: integration-controller-scope
27     parameters:
28         - string:
29             name: CONTROLLERSCOPE
30             default: '{controller-scope}'
31             description: 'Feature Only or Feature All test'
32
33 - parameter:
34     name: integration-controller-features
35     parameters:
36         - string:
37             name: CONTROLLERFEATURES
38             default: '{controller-features}'
39             description: 'Features to install in the controller separated by comma'
40
41 - parameter:
42     name: integration-distribution-stream
43     parameters:
44         - string:
45             name: DISTROSTREAM
46             default: '{stream}'
47             description: 'Distribution stream string, for suites to know which behavior to expect'
48
49 - parameter:
50     name: integration-stream-test-plan
51     parameters:
52         - string:
53             name: STREAMTESTPLAN
54             default: '{stream-test-plan}'
55             description: 'Stream-specific test plan we will run'
56
57 - parameter:
58     name: integration-test-plan
59     parameters:
60         - string:
61             name: TESTPLAN
62             default: '{test-plan}'
63             description: 'General test plan we will run unless stream-specific one is found'
64
65 - parameter:
66     name: integration-test-options
67     parameters:
68         - string:
69             name: TESTOPTIONS
70             default: '{test-options}'
71             description: 'Robot command options'
72
73 - parameter:
74     name: integration-distribution-git-url
75     parameters:
76         - string:
77             name: DISTROGITURL
78             default: 'ssh://jenkins-$SILO@git.opendaylight.org:29418/integration/distribution'
79             description: 'Distribution GIT URL (do not modify)'
80
81 - parameter:
82     name: integration-patch-refspec
83     parameters:
84         - string:
85             name: PATCHREFSPEC
86             default: '{branch}'
87             description: 'Integration Patch Refspec'
88
89 # Macro: integration-gerrit-scm
90 # Operation: this macro downloads a project gerrit
91 # Used by: all csit jobs
92
93 - scm:
94     name: integration-gerrit-scm
95     scm:
96         - git:
97             credentials-id: '{credentials-id}'
98             url: '$GIT_BASE'
99             basedir: '{basedir}'
100             refspec: '{refspec}'
101             branches:
102                 - 'origin/{branch}'
103             skip-tag: true
104             shallow-clone: true
105             choosing-strategy: 'gerrit'
106
107 # Macro: integration-distribution-scm
108 # Operation: this macro downloads the integration/distribution repo using distribution as basedir
109 # Used by: integration-patch-test-{stream} job template
110
111 - scm:
112     name: integration-distribution-scm
113     scm:
114         - git:
115             credentials-id: '{credentials-id}'
116             basedir: 'distribution'
117             url: '$DISTROGITURL'
118             refspec: ''
119             branches:
120                 - 'origin/{branch}'
121             skip-tag: true
122             shallow-clone: true
123
124 # Macro: integration-trigger-patch-submitted
125 # Operation: this macro sets a trigger for patch submitted on a path pattern
126 # Used by: {project}-verify-csit-* job templates
127
128 - trigger:
129     name: integration-trigger-patch-submitted
130     triggers:
131         - gerrit:
132             server-name: 'OpenDaylight'
133             trigger-on:
134                 - patchset-created-event:
135                     exclude-drafts: 'true'
136                     exclude-trivial-rebase: 'false'
137                     exclude-no-code-change: 'true'
138                 - draft-published-event
139                 - comment-added-contains-event:
140                     comment-contains-value: 'recheck'
141                 - comment-added-contains-event:
142                     comment-contains-value: 'reverify'
143             override-votes: true
144             gerrit-build-unstable-verified-value: +1
145             gerrit-build-unstable-codereview-value: 0
146             projects:
147               - project-compare-type: 'ANT'
148                 project-pattern: '{name}'
149                 branches:
150                   - branch-compare-type: 'ANT'
151                     branch-pattern: '**/{branch}'
152                 file-paths:
153                   - compare-type: 'ANT'
154                     pattern: '{pattern}'
155
156 # Macro: integration-trigger-patch-merged
157 # Operation: this macro sets a trigger for patch merged on a path pattern
158 # Used by: not used yet
159
160 - trigger:
161     name: integration-trigger-patch-merged
162     triggers:
163         - gerrit:
164             server-name: 'OpenDaylight'
165             trigger-on:
166                 - change-merged-event
167                 - comment-added-contains-event:
168                     comment-contains-value: 'remerge'
169             projects:
170               - project-compare-type: 'ANT'
171                 project-pattern: '{name}'
172                 branches:
173                   - branch-compare-type: 'ANT'
174                     branch-pattern: '**/{branch}'
175                 file-paths:
176                   - compare-type: 'ANT'
177                     pattern: '{pattern}'
178
179 # Macro: integration-csit-only
180 # Operation: this macro sets a trigger on reverse job list
181 # Used by: csit -only- job templates
182
183 - trigger:
184     name: integration-csit-only
185     triggers:
186         - reverse:
187             jobs: '{jobs}'
188             result: 'success'
189
190 # Macro: integration-csit-all
191 # Operation: this macro sets a periodic trigger
192 # Used by: csit -all- job teamplates
193
194 - trigger:
195     name: integration-csit-all
196     triggers:
197         - timed: 'H H * * *'
198
199 # Macro: integration-jclouds-controller-mininet
200 # Operation: this macro will spin the controller and mininet vms
201 # Used by: {project}-csit-* job templates
202
203 - wrapper:
204     name: integration-jclouds-controller-mininet
205     wrappers:
206       - jclouds:
207           instances:
208             - rk-c7-java:
209                 cloud-name: 'Rackspace DFW - Integration Dynamic Lab'
210                 count: '{controller-vms}'
211                 stop-on-terminate: False
212             - '{mininet-image}':
213                 cloud-name: '{mininet-cloud-name}'
214                 count: '{mininet-vms}'
215                 stop-on-terminate: False
216
217 # Macro: integration-jclouds-controller-devstack
218 # Operation: this macro will spin the controller and devstack vms
219 # Used by: {project}-csit-openstack job templates
220 - wrapper:
221     name: integration-jclouds-controller-devstack
222     wrappers:
223       - jclouds:
224           instances:
225             - rk-c7-java:
226                 cloud-name: 'Rackspace DFW - Integration Dynamic Lab'
227                 count: '{controller-vms}'
228                 stop-on-terminate: False
229             - rk-c7-devstack:
230                 cloud-name: 'Rackspace DFW - Devstack'
231                 count: '{openstack-vms}'
232                 stop-on-terminate: False
233
234 #################
235 # Shell Scripts #
236 #################
237
238 # Macro: integration-get-slave-addresses
239 # Operation: this macro gets the IP addresses of the dynamic vms
240 # Used by: {project}-csit-* job templates
241
242 - builder:
243     name: integration-get-slave-addresses
244     builders:
245         - shell:
246             !include-raw:
247                 - include-raw-integration-get-slave-addresses.sh
248
249 # Macro: integration-get-bundle-vars
250 # Operation: this macro gets all bundle related variables
251 # Used by: {project}-csit-3node-* job templates
252
253 - builder:
254     name: integration-get-bundle-vars
255     builders:
256         - shell:
257             !include-raw:
258                 - include-raw-integration-get-bundle-vars.sh
259
260 # Macro: integration-distribution-check
261 # Operation: this macro deploys the controller with all fetures
262 # Used by: {project}-distribution-check-{stream} job template
263
264 - builder:
265     name: integration-distribution-check
266     builders:
267         - shell:
268             !include-raw:
269                 - include-raw-integration-distribution-check.sh
270
271 # Macro: integration-deploy-controller-verify
272 # Operation: this macro deploys the controller with all fetures
273 # Used by: integration-distribution-deploy-{stream} job template
274
275 - builder:
276     name: integration-deploy-controller-verify
277     builders:
278         - shell:
279             !include-raw:
280                 - include-raw-integration-deploy-controller-verify.sh
281
282 # Macro: integration-deploy-controller-offline
283 # Operation: this macro deploys the controller with no external repo configuration
284 # Used by: integration-distrbution-offline-{stream} job template
285
286 - builder:
287     name: integration-deploy-controller-offline
288     builders:
289         - shell:
290             !include-raw:
291                 - include-raw-integration-deploy-controller-offline.sh
292
293 # Macro: integration-deply-controller-run-test
294 # Operation: this macro deploys single contoller and runs test
295 # Used by: {project}-csit-1node-* job templates
296
297 - builder:
298     name: integration-deploy-controller-run-test
299     builders:
300         - shell:
301             !include-raw:
302                 - include-raw-integration-deploy-controller-run-test.sh
303
304 # Macro: include-raw-integration-deploy-robot-testing
305 # Operation: this macro only resolves suite path from testplan
306 # Used by: {project}-openstack-{functionality}-daily-{openstack}-{odl} job templates
307
308 - builder:
309     name: include-raw-integration-deploy-devstack-testing
310     builders:
311         - shell:
312             !include-raw:
313                 - include-raw-integration-deploy-devstack-testing.sh
314
315 # Macro: integration-configure-clustering
316 # Operation: this macro configures the clustering
317 # Used by: {project}-csit-3node-* job templates
318
319 - builder:
320     name: integration-configure-clustering
321     builders:
322         - shell:
323             !include-raw:
324                 - include-raw-integration-configure-clustering.sh
325
326 # Macro: integration-start-cluster-run-test
327 # Operation: this macro starts the 3-node cluster and runs test
328 # Used by: {project}-csit-3node-* job templates
329
330 - builder:
331     name: integration-start-cluster-run-test
332     builders:
333         - shell:
334             !include-raw:
335                 - include-raw-integration-start-cluster-run-test.sh
336
337 # Macro: integration-get-bundle-url
338 # Operation: this macro gets the job generated distribution URL from distribution pom.xml
339 # Used by: integration-patch-test-{stream} job template
340
341 - builder:
342     name: integration-get-bundle-url
343     builders:
344         - shell:
345             !include-raw:
346                 - include-raw-integration-get-bundle-url.sh
347
348 # Macro: integration-get-bundle-url-root
349 # Operation: this macro gets the job generated distribution URL from root pom.xml
350 # Used by: integration-distribution-verify-{stream} job template
351
352 - builder:
353     name: integration-get-bundle-url-root
354     builders:
355         - shell:
356             !include-raw:
357                 - include-raw-integration-get-bundle-url-root.sh
358
359 # Macro: integration-install-robotframework
360 # Operation: Installs robotframework using pip to a virtualenv
361 # Used by: {project}-csit-* job templates
362
363 - builder:
364     name: integration-install-robotframework
365     builders:
366         - shell:
367             !include-raw:
368                 - include-raw-integration-install-robotframework.sh
369
370 # Macro: integration-cleanup-tmp
371 # Operation: Cleans up temporary files created by build
372 # Used by: {project}-csit-* job templates
373
374 - builder:
375     name: integration-cleanup-tmp
376     builders:
377         - shell:
378             !include-raw:
379                 - include-raw-integration-cleanup-tmp.sh
380
381 # Macro: integration-multipatch-builder
382 # Operation: checks out multiple patches and builds custom distribution
383 # Used by: integration-multipatch-test-* job templates
384
385 - builder:
386     name: integration-multipatch-builder
387     builders:
388         - shell:
389             !include-raw:
390                 - include-raw-integration-multipatch-distribution-test.sh
391
392 # Macro: integration-cleanup-worspace
393 # Operation: Cleans up files possibly left there by the previous build
394 # Used by: {project}-csit-* job templates
395
396 - builder:
397     name: integration-cleanup-workspace
398     builders:
399         - shell:
400             !include-raw:
401                 - include-raw-integration-cleanup-workspace.sh
402
403 # Macro: integration-rebase-patch
404 # Operation: For cloned project, rebase checked-out Gerrit patch onto $BRANCH.
405 # Used by: integration-patch-distribution-* job template
406
407 - builder:
408     name: integration-rebase-gerrit-patch
409     builders:
410         - shell:
411             !include-raw:
412                 - include-raw-integration-rebase-gerrit-patch.sh
413
414 - builder:
415     name: integration-deploy-openstack-run-test
416     builders:
417         - shell:
418             !include-raw:
419                 - include-raw-integration-deploy-openstack-run-test.sh
420 ##############
421 # Publishers #
422 ##############
423
424 # Macro: integration-robot
425 # Operation: this macro publishes robot results
426 # Used by: {project}-csit-* job templates
427
428 - publisher:
429     name: integration-robot
430     publishers:
431         - robot:
432             output-path: ''
433             other-files: ''
434             unstable-threshold: '{unstable-if}'
435             pass-threshold: '{pass-if}'
436             only-critical: false