openci: Run jobs on xci slaves
[releng.git] / jjb / xci / xci-merge-jobs.yaml
1 ---
2 - project:
3     name: 'opnfv-xci-merge'
4
5     project: releng-xci
6     # -------------------------------
7     # branches
8     # -------------------------------
9     stream:
10       - master:
11           branch: '{stream}'
12           disabled: false
13     # -------------------------------
14     # distros
15     # -------------------------------
16     distro:
17       - ubuntu:
18           disabled: false
19           kill-phase-on: FAILURE
20           abort-all-job: true
21       - centos:
22           disabled: true
23           kill-phase-on: NEVER
24           abort-all-job: false
25       - opensuse:
26           disabled: false
27           kill-phase-on: FAILURE
28           abort-all-job: true
29     # -------------------------------
30     # postmerge promotion phases
31     # -------------------------------
32     phase:
33       - 'deploy'
34       - 'healthcheck'
35     # -------------------------------
36     # jobs
37     # -------------------------------
38     jobs:
39       - 'xci-merge-virtual-{stream}'
40       - 'xci-merge-promote-virtual-{stream}'
41       - 'xci-merge-{distro}-virtual-{stream}'
42       - 'xci-merge-{distro}-{phase}-virtual-{stream}'
43 # -------------------------------
44 # job templates
45 # -------------------------------
46 - job-template:
47     name: 'xci-merge-virtual-{stream}'
48
49     project-type: multijob
50
51     disabled: '{obj:disabled}'
52
53     concurrent: false
54
55     properties:
56       - logrotate-default
57
58     wrappers:
59       - ssh-agent-wrapper
60       - build-timeout:
61           timeout: 240
62       - fix-workspace-permissions
63
64     scm:
65       - git-scm-gerrit
66
67     triggers:
68       - gerrit:
69           server-name: 'gerrit.opnfv.org'
70           trigger-on:
71             - change-merged-event
72             - comment-added-contains-event:
73                 comment-contains-value: 'remerge'
74           projects:
75             - project-compare-type: 'ANT'
76               project-pattern: 'releng-xci'
77               branches:
78                 - branch-compare-type: 'ANT'
79                   branch-pattern: '**/{branch}'
80               disable-strict-forbidden-file-verification: 'false'
81               forbidden-file-paths:
82                 - compare-type: ANT
83                   pattern: 'xci/scripts/vm/**'
84                 - compare-type: ANT
85                   pattern: 'docs/**'
86                 - compare-type: ANT
87                   pattern: 'prototypes/**'
88                 - compare-type: ANT
89                   pattern: 'upstream/**'
90                 - compare-type: ANT
91                   pattern: 'INFO.yaml'
92             - project-compare-type: 'REG_EXP'
93               project-pattern: 'sfc|sdnvpn|releng-xci-scenarios'
94               branches:
95                 - branch-compare-type: 'ANT'
96                   branch-pattern: '**/{branch}'
97               disable-strict-forbidden-file-verification: 'true'
98               file-paths:
99                 - compare-type: ANT
100                   pattern: 'scenarios/**'
101           readable-message: true
102           custom-url: '* $JOB_NAME $BUILD_URL'
103
104     parameters:
105       - project-parameter:
106           project: $GERRIT_PROJECT
107           branch: '{branch}'
108       - label:
109           name: SLAVE_LABEL
110           default: 'xci-virtual'
111       - string:
112           name: CI_LOOP
113           default: 'merge'
114       - string:
115           name: FUNCTEST_MODE
116           default: 'tier'
117       - string:
118           name: FUNCTEST_SUITE_NAME
119           default: 'healthcheck'
120       - string:
121           name: DISTRO
122           default: 'all'
123       - string:
124           name: CLEAN_DIB_IMAGES
125           default: 'true'
126       - string:
127           name: GIT_BASE
128           default: https://gerrit.opnfv.org/gerrit/$PROJECT
129           description: 'Git URL to use on this Jenkins Slave'
130
131     builders:
132       - 'xci-merge-set-scenario-macro'
133       - inject:
134           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
135       - description-setter:
136           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
137       - multijob:
138           name: deploy and test
139           condition: SUCCESSFUL
140           projects:
141             - name: 'xci-merge-opensuse-virtual-{stream}'
142               current-parameters: false
143               predefined-parameters: |
144                 DISTRO=opensuse
145                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
146                 GERRIT_PROJECT=$GERRIT_PROJECT
147                 GERRIT_BRANCH=$GERRIT_BRANCH
148                 GERRIT_REFSPEC=$GERRIT_REFSPEC
149                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
150                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
151                 CI_LOOP=$CI_LOOP
152                 FUNCTEST_MODE=$FUNCTEST_MODE
153                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
154               node-parameters: false
155               kill-phase-on: FAILURE
156               abort-all-job: true
157             - name: 'xci-merge-ubuntu-virtual-{stream}'
158               current-parameters: false
159               predefined-parameters: |
160                 DISTRO=ubuntu
161                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
162                 GERRIT_PROJECT=$GERRIT_PROJECT
163                 GERRIT_BRANCH=$GERRIT_BRANCH
164                 GERRIT_REFSPEC=$GERRIT_REFSPEC
165                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
166                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
167                 CI_LOOP=$CI_LOOP
168                 FUNCTEST_MODE=$FUNCTEST_MODE
169                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
170               node-parameters: false
171               kill-phase-on: FAILURE
172               abort-all-job: true
173             - name: 'xci-merge-centos-virtual-{stream}'
174               current-parameters: false
175               predefined-parameters: |
176                 DISTRO=centos
177                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
178                 GERRIT_PROJECT=$GERRIT_PROJECT
179                 GERRIT_BRANCH=$GERRIT_BRANCH
180                 GERRIT_REFSPEC=$GERRIT_REFSPEC
181                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
182                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
183                 CI_LOOP=$CI_LOOP
184                 FUNCTEST_MODE=$FUNCTEST_MODE
185                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
186               node-parameters: false
187               kill-phase-on: NEVER
188               abort-all-job: false
189       - inject:
190           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
191       - multijob:
192           name: promote
193           condition: SUCCESSFUL
194           projects:
195             - name: 'xci-merge-promote-virtual-{stream}'
196               current-parameters: true
197               predefined-parameters: |
198                 GERRIT_PROJECT=$GERRIT_PROJECT
199                 GERRIT_BRANCH=$GERRIT_BRANCH
200                 GERRIT_REFSPEC=$GERRIT_REFSPEC
201                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
202                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
203                 CI_LOOP=$CI_LOOP
204                 FUNCTEST_MODE=$FUNCTEST_MODE
205                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
206               node-parameters: true
207               kill-phase-on: NEVER
208               abort-all-job: true
209
210 - job-template:
211     name: 'xci-merge-{distro}-virtual-{stream}'
212
213     project-type: multijob
214
215     disabled: '{obj:disabled}'
216
217     concurrent: false
218
219     properties:
220       - logrotate-default
221       - build-blocker:
222           use-build-blocker: true
223           blocking-jobs:
224             - 'xci-verify-{distro}-.*'
225             - 'xci-merge-{distro}-.*'
226             - 'xci-os.*'
227             - 'xci-k8.*'
228             - 'openstack-bifrost-verify-{distro}-.*'
229             - 'xci-osa-verify-{distro}-.*'
230             - 'xci-osa-periodic-{distro}-.*'
231           block-level: 'NODE'
232       - throttle:
233           max-per-node: 1
234           max-total: 3
235           categories:
236             - xci-verify-virtual
237           option: category
238
239     wrappers:
240       - ssh-agent-wrapper
241       - build-timeout:
242           timeout: 240
243       - fix-workspace-permissions
244
245     scm:
246       - git-scm-gerrit
247
248     parameters:
249       - project-parameter:
250           project: $GERRIT_PROJECT
251           branch: '{branch}'
252       - label:
253           name: SLAVE_LABEL
254           default: 'xci-virtual'
255       - string:
256           name: CI_LOOP
257           default: 'merge'
258       - string:
259           name: FUNCTEST_VERSION
260           default: 'hunter'
261       - string:
262           name: FUNCTEST_MODE
263           default: 'tier'
264       - string:
265           name: FUNCTEST_SUITE_NAME
266           default: 'healthcheck'
267       - string:
268           name: DISTRO
269           default: '{distro}'
270       - string:
271           name: CLEAN_DIB_IMAGES
272           default: 'true'
273       - string:
274           name: GIT_BASE
275           default: https://gerrit.opnfv.org/gerrit/$PROJECT
276           description: 'Git URL to use on this Jenkins Slave'
277
278     builders:
279       - 'xci-merge-set-scenario-macro'
280       - inject:
281           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
282       - description-setter:
283           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
284       - multijob:
285           name: deploy
286           condition: SUCCESSFUL
287           projects:
288             - name: 'xci-merge-{distro}-deploy-virtual-{stream}'
289               current-parameters: true
290               predefined-parameters: |
291                 DISTRO={distro}
292                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
293                 GERRIT_PROJECT=$GERRIT_PROJECT
294                 GERRIT_BRANCH=$GERRIT_BRANCH
295                 GERRIT_REFSPEC=$GERRIT_REFSPEC
296                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
297                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
298                 FUNCTEST_VERSION=$FUNCTEST_VERSION
299                 FUNCTEST_MODE=$FUNCTEST_MODE
300                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
301               node-parameters: true
302               kill-phase-on: '{kill-phase-on}'
303               abort-all-job: '{abort-all-job}'
304       - multijob:
305           name: healthcheck
306           condition: SUCCESSFUL
307           projects:
308             - name: 'xci-merge-{distro}-healthcheck-virtual-{stream}'
309               current-parameters: true
310               predefined-parameters: |
311                 DISTRO={distro}
312                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
313                 GERRIT_PROJECT=$GERRIT_PROJECT
314                 GERRIT_BRANCH=$GERRIT_BRANCH
315                 GERRIT_REFSPEC=$GERRIT_REFSPEC
316                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
317                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
318                 CI_LOOP=$CI_LOOP
319                 FUNCTEST_VERSION=$FUNCTEST_VERSION
320                 FUNCTEST_MODE=$FUNCTEST_MODE
321                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
322               node-parameters: true
323               kill-phase-on: '{kill-phase-on}'
324               abort-all-job: '{abort-all-job}'
325
326     publishers:
327       - postbuildscript:
328           builders:
329             - role: BOTH
330               build-on:
331                 - ABORTED
332                 - FAILURE
333                 - NOT_BUILT
334                 - SUCCESS
335                 - UNSTABLE
336               build-steps:
337                 - shell: !include-raw: ./xci-cleanup.sh
338           mark-unstable-if-failed: true
339
340 - job-template:
341     name: 'xci-merge-{distro}-{phase}-virtual-{stream}'
342
343     disabled: false
344
345     concurrent: false
346
347     properties:
348       - logrotate-default
349       - build-blocker:
350           use-build-blocker: true
351           blocking-jobs:
352             - '.*-bifrost-verify-.*'
353             - '.*-bifrost-periodic-.*'
354             - 'osa-verify-.*'
355             - 'osa-periodic-.*'
356           block-level: 'NODE'
357
358     parameters:
359       - string:
360           name: PROJECT
361           default: $GERRIT_PROJECT
362       - string:
363           name: DISTRO
364           default: 'ubuntu'
365       - string:
366           name: CI_LOOP
367           default: 'merge'
368       - string:
369           name: FUNCTEST_VERSION
370           default: 'hunter'
371       - string:
372           name: FUNCTEST_MODE
373           default: 'tier'
374       - string:
375           name: FUNCTEST_SUITE_NAME
376           default: 'healthcheck'
377       - string:
378           name: XCI_FLAVOR
379           default: 'mini'
380       - string:
381           name: CLEAN_DIB_IMAGES
382           default: 'true'
383       - string:
384           name: OPNFV_RELENG_DEV_PATH
385           default: $WORKSPACE/
386       - string:
387           name: GIT_BASE
388           default: https://gerrit.opnfv.org/gerrit/$PROJECT
389           description: 'Git URL to use on this Jenkins Slave'
390
391     wrappers:
392       - inject:
393           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
394       - ssh-agent-wrapper
395       - build-timeout:
396           timeout: 240
397       - fix-workspace-permissions
398
399     scm:
400       - git-scm-gerrit
401
402     builders:
403       - description-setter:
404           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
405       - 'xci-merge-{phase}-macro'
406
407 - job-template:
408     name: 'xci-merge-promote-virtual-{stream}'
409
410     disabled: false
411
412     concurrent: false
413
414     properties:
415       - logrotate-default
416
417     parameters:
418       - string:
419           name: PROJECT
420           default: $GERRIT_PROJECT
421       - string:
422           name: CI_LOOP
423           default: 'merge'
424       - string:
425           name: FUNCTEST_MODE
426           default: 'tier'
427       - string:
428           name: FUNCTEST_SUITE_NAME
429           default: 'healthcheck'
430       - string:
431           name: DISTRO
432           default: 'all'
433       - string:
434           name: OPNFV_RELENG_DEV_PATH
435           default: $WORKSPACE/
436       - string:
437           name: LOCAL_PROMOTION_METADATA_FILE
438           default: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
439       - string:
440           name: REMOTE_PROMOTION_METADATA_FILE
441           default: "gs://artifacts.opnfv.org/xci/pipeline/merge/$DEPLOY_SCENARIO.properties"
442       - string:
443           name: GIT_BASE
444           default: https://gerrit.opnfv.org/gerrit/$PROJECT
445           description: 'Git URL to use on this Jenkins Slave'
446
447     wrappers:
448       - inject:
449           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
450       - ssh-agent-wrapper
451       - build-timeout:
452           timeout: 240
453       - fix-workspace-permissions
454
455     builders:
456       - description-setter:
457           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
458       - 'xci-merge-promote-macro'
459
460 # -------------------------------
461 # builder macros
462 # -------------------------------
463 - builder:
464     name: 'xci-merge-set-scenario-macro'
465     builders:
466       - shell:
467           !include-raw: ./xci-set-scenario.sh
468
469 - builder:
470     name: 'xci-merge-deploy-macro'
471     builders:
472       - shell:
473           !include-raw: ./xci-start-new-vm.sh
474
475       - shell:
476           !include-raw: ./xci-start-deployment.sh
477
478 - builder:
479     name: 'xci-merge-healthcheck-macro'
480     builders:
481       - shell:
482           !include-raw: ./xci-run-functest.sh
483
484 - builder:
485     name: 'xci-merge-promote-macro'
486     builders:
487       - shell:
488           !include-raw: ./xci-promote.sh