xci: Set CI_LOOP, FUNCTEST_MODE, and FUNCTEST_SUITE_NAME in jobs
[releng.git] / jjb / xci / xci-verify-jobs.yml
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: false
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             - 'openstack-bifrost-verify-{distro}-.*'
71             - 'xci-osa-verify-{distro}-.*'
72             - 'xci-osa-periodic-{distro}-.*'
73           block-level: 'NODE'
74       - throttle:
75           max-per-node: 2
76           max-total: 10
77           categories:
78             - xci-verify-virtual
79           option: category
80
81     wrappers:
82       - ssh-agent-wrapper
83       - build-timeout:
84           timeout: 240
85       - fix-workspace-permissions
86
87     scm:
88       - git-scm-gerrit
89
90     triggers:
91       - gerrit:
92           server-name: 'gerrit.opnfv.org'
93           trigger-on:
94             - patchset-created-event:
95                 exclude-drafts: 'false'
96                 exclude-trivial-rebase: 'false'
97                 exclude-no-code-change: 'true'
98             - draft-published-event
99             - comment-added-contains-event:
100                 comment-contains-value: 'recheck'
101             - comment-added-contains-event:
102                 comment-contains-value: 'reverify'
103           projects:
104             - project-compare-type: 'ANT'
105               project-pattern: 'releng-xci'
106               branches:
107                 - branch-compare-type: 'ANT'
108                   branch-pattern: '**/{branch}'
109               disable-strict-forbidden-file-verification: 'false'
110               forbidden-file-paths:
111                 - compare-type: ANT
112                   pattern: 'xci/scripts/vm/**'
113                 - compare-type: ANT
114                   pattern: 'docs/**'
115                 - compare-type: ANT
116                   pattern: 'prototypes/**'
117                 - compare-type: ANT
118                   pattern: 'upstream/**'
119             - project-compare-type: 'REG_EXP'
120               project-pattern: 'sfc|sdnvpn'
121               branches:
122                 - branch-compare-type: 'ANT'
123                   branch-pattern: '**/{branch}'
124               disable-strict-forbidden-file-verification: 'true'
125               file-paths:
126                 - compare-type: ANT
127                   pattern: 'scenarios/**'
128           readable-message: true
129           custom-url: '* $JOB_NAME $BUILD_URL'
130           skip-vote:
131             successful: '{obj:successful}'
132             failed: '{obj:failed}'
133             unstable: '{obj:unstable}'
134             notbuilt: '{obj:notbuilt}'
135
136     parameters:
137       - project-parameter:
138           project: $GERRIT_PROJECT
139           branch: '{branch}'
140       - label:
141           name: SLAVE_LABEL
142           default: 'xci-virtual'
143       - string:
144           name: DISTRO
145           default: '{distro}'
146       - string:
147           name: CLEAN_DIB_IMAGES
148           default: 'true'
149       - string:
150           name: CI_LOOP
151           default: 'verify'
152       - string:
153           name: FUNCTEST_MODE
154           default: 'tier'
155       - string:
156           name: FUNCTEST_SUITE_NAME
157           default: 'healthcheck'
158       - string:
159           name: GIT_BASE
160           default: https://gerrit.opnfv.org/gerrit/$PROJECT
161           description: 'Git URL to use on this Jenkins Slave'
162
163     builders:
164       - 'xci-verify-set-scenario-macro'
165       - inject:
166           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
167       - description-setter:
168           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
169       - multijob:
170           name: deploy
171           condition: SUCCESSFUL
172           projects:
173             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
174               current-parameters: true
175               predefined-parameters: |
176                 DISTRO={distro}
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               node-parameters: true
185               kill-phase-on: FAILURE
186               abort-all-job: true
187       - multijob:
188           name: healthcheck
189           condition: SUCCESSFUL
190           projects:
191             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
192               current-parameters: true
193               predefined-parameters: |
194                 DISTRO={distro}
195                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
196                 GERRIT_PROJECT=$GERRIT_PROJECT
197                 GERRIT_BRANCH=$GERRIT_BRANCH
198                 GERRIT_REFSPEC=$GERRIT_REFSPEC
199                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
200                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
201                 CI_LOOP=$CI_LOOP
202                 FUNCTEST_MODE=$FUNCTEST_MODE
203                 FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
204               node-parameters: true
205               kill-phase-on: NEVER
206               abort-all-job: true
207
208     publishers:
209       - postbuildscript:
210           script-only-if-succeeded: false
211           script-only-if-failed: false
212           builders:
213             - shell:
214                 !include-raw: ./xci-cleanup.sh
215
216
217 - job-template:
218     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
219
220     disabled: false
221
222     concurrent: true
223
224     properties:
225       - logrotate-default
226       - build-blocker:
227           use-build-blocker: true
228           blocking-jobs:
229             - '.*-bifrost-verify-.*'
230             - '.*-bifrost-periodic-.*'
231             - 'osa-verify-.*'
232             - 'osa-periodic-.*'
233           block-level: 'NODE'
234
235     parameters:
236       - string:
237           name: PROJECT
238           default: $GERRIT_PROJECT
239       - string:
240           name: DISTRO
241           default: 'ubuntu'
242       - string:
243           name: CI_LOOP
244           default: 'verify'
245       - string:
246           name: FUNCTEST_MODE
247           default: 'tier'
248       - string:
249           name: FUNCTEST_SUITE_NAME
250           default: 'healthcheck'
251       - string:
252           name: XCI_FLAVOR
253           default: 'mini'
254       - string:
255           name: CLEAN_DIB_IMAGES
256           default: 'true'
257       - string:
258           name: OPNFV_RELENG_DEV_PATH
259           default: $WORKSPACE/
260       - string:
261           name: GIT_BASE
262           default: https://gerrit.opnfv.org/gerrit/$PROJECT
263           description: 'Git URL to use on this Jenkins Slave'
264
265     wrappers:
266       - inject:
267           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
268       - ssh-agent-wrapper
269       - build-timeout:
270           timeout: 240
271       - fix-workspace-permissions
272
273     scm:
274       - git-scm-gerrit
275
276     builders:
277       - description-setter:
278           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
279       - 'xci-verify-{phase}-macro'
280
281 # -------------------------------
282 # builder macros
283 # -------------------------------
284 - builder:
285     name: 'xci-verify-set-scenario-macro'
286     builders:
287       - shell:
288           !include-raw: ./xci-set-scenario.sh
289
290 - builder:
291     name: 'xci-verify-deploy-macro'
292     builders:
293       - shell:
294           !include-raw: ./xci-start-new-vm.sh
295
296       - shell:
297           !include-raw: ./xci-start-deployment.sh
298
299 - builder:
300     name: 'xci-verify-healthcheck-macro'
301     builders:
302       - shell:
303           !include-raw: ./xci-run-functest.sh