xci: Reconfigure xci-daily-virtual jobs
[releng.git] / jjb / xci / xci-verify-jobs.yaml
1 ---
2 - project:
3     name: 'opnfv-xci-verify'
4
5     project: releng-xci
6     # -------------------------------
7     # branches
8     # -------------------------------
9     stream:
10       - master:
11           branch: '{stream}'
12     # -------------------------------
13     # distros
14     # -------------------------------
15     distro:
16       - ubuntu:
17           disabled: false
18           successful: false
19           failed: false
20           unstable: false
21           notbuilt: false
22       - centos:
23           disabled: true
24           successful: true
25           failed: true
26           unstable: true
27           notbuilt: true
28       - opensuse:
29           disabled: false
30           successful: false
31           failed: false
32           unstable: false
33           notbuilt: false
34     # -------------------------------
35     # type
36     # -------------------------------
37     type:
38       - virtual
39     # -------------------------------
40     # patch verification phases
41     # -------------------------------
42     phase:
43       - 'deploy'
44       - 'healthcheck'
45     # -------------------------------
46     # jobs
47     # -------------------------------
48     jobs:
49       - 'xci-verify-{distro}-{type}-{stream}'
50       - 'xci-verify-{distro}-{phase}-{type}-{stream}'
51 # -------------------------------
52 # job templates
53 # -------------------------------
54 - job-template:
55     name: 'xci-verify-{distro}-{type}-{stream}'
56
57     project-type: multijob
58
59     disabled: '{obj:disabled}'
60
61     concurrent: true
62
63     properties:
64       - logrotate-default
65       - build-blocker:
66           use-build-blocker: true
67           blocking-jobs:
68             - 'xci-verify-{distro}-.*'
69             - 'xci-merge-{distro}-.*'
70             - 'xci-os-.*'
71             - 'openstack-bifrost-verify-{distro}-.*'
72             - 'xci-osa-verify-{distro}-.*'
73             - 'xci-osa-periodic-{distro}-.*'
74           block-level: 'NODE'
75       - throttle:
76           max-per-node: 2
77           max-total: 10
78           categories:
79             - xci-verify-virtual
80           option: category
81
82     wrappers:
83       - ssh-agent-wrapper
84       - build-timeout:
85           timeout: 240
86       - fix-workspace-permissions
87
88     scm:
89       - git-scm-gerrit
90
91     triggers:
92       - gerrit:
93           server-name: 'gerrit.opnfv.org'
94           trigger-on:
95             - patchset-created-event:
96                 exclude-drafts: 'false'
97                 exclude-trivial-rebase: 'false'
98                 exclude-no-code-change: 'true'
99             - draft-published-event
100             - comment-added-contains-event:
101                 comment-contains-value: 'recheck'
102             - comment-added-contains-event:
103                 comment-contains-value: 'reverify'
104           projects:
105             - project-compare-type: 'ANT'
106               project-pattern: 'releng-xci'
107               branches:
108                 - branch-compare-type: 'ANT'
109                   branch-pattern: '**/{branch}'
110               disable-strict-forbidden-file-verification: 'false'
111               forbidden-file-paths:
112                 - compare-type: ANT
113                   pattern: 'xci/scripts/vm/**'
114                 - compare-type: ANT
115                   pattern: 'docs/**'
116                 - compare-type: ANT
117                   pattern: 'upstream/**'
118             - project-compare-type: 'REG_EXP'
119               project-pattern: 'sfc|sdnvpn|releng-xci-scenarios'
120               branches:
121                 - branch-compare-type: 'ANT'
122                   branch-pattern: '**/{branch}'
123               disable-strict-forbidden-file-verification: 'true'
124               file-paths:
125                 - compare-type: ANT
126                   pattern: 'scenarios/**'
127           readable-message: true
128           custom-url: '* $JOB_NAME $BUILD_URL'
129           skip-vote:
130             successful: '{obj:successful}'
131             failed: '{obj:failed}'
132             unstable: '{obj:unstable}'
133             notbuilt: '{obj:notbuilt}'
134
135     parameters:
136       - project-parameter:
137           project: $GERRIT_PROJECT
138           branch: '{branch}'
139       - label:
140           name: SLAVE_LABEL
141           default: 'xci-virtual'
142       - string:
143           name: DISTRO
144           default: '{distro}'
145       - string:
146           name: CLEAN_DIB_IMAGES
147           default: 'true'
148       - string:
149           name: CI_LOOP
150           default: 'verify'
151       - string:
152           name: FUNCTEST_MODE
153           default: 'tier'
154       - string:
155           name: FUNCTEST_SUITE_NAME
156           default: 'healthcheck'
157       - string:
158           name: GIT_BASE
159           default: https://gerrit.opnfv.org/gerrit/$PROJECT
160           description: 'Git URL to use on this Jenkins Slave'
161
162     builders:
163       - 'xci-verify-set-scenario-macro'
164       - inject:
165           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
166       - description-setter:
167           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
168       - multijob:
169           name: deploy
170           condition: SUCCESSFUL
171           projects:
172             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
173               current-parameters: true
174               predefined-parameters: |
175                 DISTRO={distro}
176                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
177                 GERRIT_PROJECT=$GERRIT_PROJECT
178                 GERRIT_BRANCH=$GERRIT_BRANCH
179                 GERRIT_REFSPEC=$GERRIT_REFSPEC
180                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
181                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
182                 CI_LOOP=$CI_LOOP
183               node-parameters: true
184               kill-phase-on: FAILURE
185               abort-all-job: true
186       - multijob:
187           name: healthcheck
188           condition: SUCCESSFUL
189           projects:
190             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
191               current-parameters: true
192               predefined-parameters: |
193                 DISTRO={distro}
194                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
195                 GERRIT_PROJECT=$GERRIT_PROJECT
196                 GERRIT_BRANCH=$GERRIT_BRANCH
197                 GERRIT_REFSPEC=$GERRIT_REFSPEC
198                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
199                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
200                 CI_LOOP=$CI_LOOP
201                 FUNCTEST_MODE=$FUNCTEST_MODE
202                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
203               node-parameters: true
204               kill-phase-on: NEVER
205               abort-all-job: true
206
207     publishers:
208       - postbuildscript:
209           builders:
210             - role: BOTH
211               build-on:
212                 - ABORTED
213                 - FAILURE
214                 - NOT_BUILT
215                 - SUCCESS
216                 - UNSTABLE
217               build-steps:
218                 - shell: !include-raw: ./xci-cleanup.sh
219           mark-unstable-if-failed: true
220
221
222 - job-template:
223     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
224
225     disabled: false
226
227     concurrent: true
228
229     properties:
230       - logrotate-default
231       - build-blocker:
232           use-build-blocker: true
233           blocking-jobs:
234             - '.*-bifrost-verify-.*'
235             - '.*-bifrost-periodic-.*'
236             - 'osa-verify-.*'
237             - 'osa-periodic-.*'
238           block-level: 'NODE'
239
240     parameters:
241       - string:
242           name: PROJECT
243           default: $GERRIT_PROJECT
244       - string:
245           name: DISTRO
246           default: 'ubuntu'
247       - string:
248           name: CI_LOOP
249           default: 'verify'
250       - string:
251           name: FUNCTEST_MODE
252           default: 'tier'
253       - string:
254           name: FUNCTEST_SUITE_NAME
255           default: 'healthcheck'
256       - string:
257           name: XCI_FLAVOR
258           default: 'mini'
259       - string:
260           name: CLEAN_DIB_IMAGES
261           default: 'true'
262       - string:
263           name: OPNFV_RELENG_DEV_PATH
264           default: $WORKSPACE/
265       - string:
266           name: GIT_BASE
267           default: https://gerrit.opnfv.org/gerrit/$PROJECT
268           description: 'Git URL to use on this Jenkins Slave'
269
270     wrappers:
271       - inject:
272           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
273       - ssh-agent-wrapper
274       - build-timeout:
275           timeout: 240
276       - fix-workspace-permissions
277
278     scm:
279       - git-scm-gerrit
280
281     builders:
282       - description-setter:
283           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
284       - 'xci-verify-{phase}-macro'
285
286 # -------------------------------
287 # builder macros
288 # -------------------------------
289 - builder:
290     name: 'xci-verify-set-scenario-macro'
291     builders:
292       - shell:
293           !include-raw: ./xci-set-scenario.sh
294
295 - builder:
296     name: 'xci-verify-deploy-macro'
297     builders:
298       - shell:
299           !include-raw: ./xci-start-new-vm.sh
300
301       - shell:
302           !include-raw: ./xci-start-deployment.sh
303
304 - builder:
305     name: 'xci-verify-healthcheck-macro'
306     builders:
307       - shell:
308           !include-raw: ./xci-run-functest.sh