c95917f09dc11a2585414b2a026e0d98960f7a19
[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-.*-{distro}-merge-.*'
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             - project-compare-type: 'REG_EXP'
114               project-pattern: 'sfc|sdnvpn'
115               branches:
116                 - branch-compare-type: 'ANT'
117                   branch-pattern: '**/{branch}'
118               disable-strict-forbidden-file-verification: 'true'
119               file-paths:
120                 - compare-type: ANT
121                   pattern: 'scenarios/**'
122           readable-message: true
123           custom-url: '* $JOB_NAME $BUILD_URL'
124           skip-vote:
125             successful: '{obj:successful}'
126             failed: '{obj:failed}'
127             unstable: '{obj:unstable}'
128             notbuilt: '{obj:notbuilt}'
129
130     parameters:
131       - project-parameter:
132           project: $GERRIT_PROJECT
133           branch: '{branch}'
134       - label:
135           name: SLAVE_LABEL
136           default: 'xci-virtual'
137       - string:
138           name: DISTRO
139           default: '{distro}'
140       - string:
141           name: CLEAN_DIB_IMAGES
142           default: 'true'
143       - string:
144           name: GIT_BASE
145           default: https://gerrit.opnfv.org/gerrit/$PROJECT
146           description: 'Git URL to use on this Jenkins Slave'
147
148     builders:
149       - 'xci-verify-set-scenario-macro'
150       - inject:
151           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
152       - description-setter:
153           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
154       - multijob:
155           name: deploy
156           condition: SUCCESSFUL
157           projects:
158             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
159               current-parameters: true
160               predefined-parameters: |
161                 DISTRO={distro}
162                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
163                 GERRIT_PROJECT=$GERRIT_PROJECT
164                 GERRIT_BRANCH=$GERRIT_BRANCH
165                 GERRIT_REFSPEC=$GERRIT_REFSPEC
166                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
167                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
168               node-parameters: true
169               kill-phase-on: FAILURE
170               abort-all-job: true
171       - multijob:
172           name: healthcheck
173           condition: SUCCESSFUL
174           projects:
175             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
176               current-parameters: true
177               predefined-parameters: |
178                 DISTRO={distro}
179                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
180                 GERRIT_PROJECT=$GERRIT_PROJECT
181                 GERRIT_BRANCH=$GERRIT_BRANCH
182                 GERRIT_REFSPEC=$GERRIT_REFSPEC
183                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
184                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
185                 FUNCTEST_MODE=tier
186                 FUNCTEST_TIER=healthcheck
187               node-parameters: true
188               kill-phase-on: NEVER
189               abort-all-job: true
190
191     publishers:
192       - postbuildscript:
193           script-only-if-succeeded: false
194           script-only-if-failed: false
195           builders:
196             - shell:
197                 !include-raw: ./xci-cleanup.sh
198
199
200 - job-template:
201     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
202
203     disabled: false
204
205     concurrent: true
206
207     properties:
208       - logrotate-default
209       - build-blocker:
210           use-build-blocker: true
211           blocking-jobs:
212             - '.*-bifrost-verify-.*'
213             - '.*-bifrost-periodic-.*'
214             - 'osa-verify-.*'
215             - 'osa-periodic-.*'
216           block-level: 'NODE'
217
218     parameters:
219       - string:
220           name: PROJECT
221           default: $GERRIT_PROJECT
222       - string:
223           name: DISTRO
224           default: 'ubuntu'
225       - string:
226           name: FUNCTEST_MODE
227           default: 'tier'
228       - string:
229           name: FUNCTEST_SUITE_NAME
230           default: 'healthcheck'
231       - string:
232           name: XCI_FLAVOR
233           default: 'mini'
234       - string:
235           name: CLEAN_DIB_IMAGES
236           default: 'true'
237       - string:
238           name: OPNFV_RELENG_DEV_PATH
239           default: $WORKSPACE/
240       - string:
241           name: INSTALLER_TYPE
242           default: $XCI_INSTALLER
243       - string:
244           name: GIT_BASE
245           default: https://gerrit.opnfv.org/gerrit/$PROJECT
246           description: 'Git URL to use on this Jenkins Slave'
247
248     wrappers:
249       - inject:
250           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
251       - ssh-agent-wrapper
252       - build-timeout:
253           timeout: 240
254       - fix-workspace-permissions
255
256     scm:
257       - git-scm-gerrit
258
259     builders:
260       - description-setter:
261           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
262       - 'xci-verify-{phase}-macro'
263
264 # -------------------------------
265 # builder macros
266 # -------------------------------
267 - builder:
268     name: 'xci-verify-set-scenario-macro'
269     builders:
270       - shell:
271           !include-raw: ./xci-set-scenario.sh
272
273 - builder:
274     name: 'xci-verify-deploy-macro'
275     builders:
276       - shell:
277           !include-raw: ./xci-start-new-vm.sh
278
279       - shell:
280           !include-raw: ./xci-start-deployment.sh
281
282 - builder:
283     name: 'xci-verify-healthcheck-macro'
284     builders:
285       - shell:
286           !include-raw: ./xci-run-functest.sh