xci: Skip the deployment for upstream and prototype changes
[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: GIT_BASE
151           default: https://gerrit.opnfv.org/gerrit/$PROJECT
152           description: 'Git URL to use on this Jenkins Slave'
153
154     builders:
155       - 'xci-verify-set-scenario-macro'
156       - inject:
157           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
158       - description-setter:
159           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
160       - multijob:
161           name: deploy
162           condition: SUCCESSFUL
163           projects:
164             - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
165               current-parameters: true
166               predefined-parameters: |
167                 DISTRO={distro}
168                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
169                 GERRIT_PROJECT=$GERRIT_PROJECT
170                 GERRIT_BRANCH=$GERRIT_BRANCH
171                 GERRIT_REFSPEC=$GERRIT_REFSPEC
172                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
173                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
174               node-parameters: true
175               kill-phase-on: FAILURE
176               abort-all-job: true
177       - multijob:
178           name: healthcheck
179           condition: SUCCESSFUL
180           projects:
181             - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
182               current-parameters: true
183               predefined-parameters: |
184                 DISTRO={distro}
185                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
186                 GERRIT_PROJECT=$GERRIT_PROJECT
187                 GERRIT_BRANCH=$GERRIT_BRANCH
188                 GERRIT_REFSPEC=$GERRIT_REFSPEC
189                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
190                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
191                 FUNCTEST_MODE=tier
192                 FUNCTEST_TIER=healthcheck
193               node-parameters: true
194               kill-phase-on: NEVER
195               abort-all-job: true
196
197     publishers:
198       - postbuildscript:
199           script-only-if-succeeded: false
200           script-only-if-failed: false
201           builders:
202             - shell:
203                 !include-raw: ./xci-cleanup.sh
204
205
206 - job-template:
207     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
208
209     disabled: false
210
211     concurrent: true
212
213     properties:
214       - logrotate-default
215       - build-blocker:
216           use-build-blocker: true
217           blocking-jobs:
218             - '.*-bifrost-verify-.*'
219             - '.*-bifrost-periodic-.*'
220             - 'osa-verify-.*'
221             - 'osa-periodic-.*'
222           block-level: 'NODE'
223
224     parameters:
225       - string:
226           name: PROJECT
227           default: $GERRIT_PROJECT
228       - string:
229           name: DISTRO
230           default: 'ubuntu'
231       - string:
232           name: FUNCTEST_MODE
233           default: 'tier'
234       - string:
235           name: FUNCTEST_SUITE_NAME
236           default: 'healthcheck'
237       - string:
238           name: XCI_FLAVOR
239           default: 'mini'
240       - string:
241           name: CLEAN_DIB_IMAGES
242           default: 'true'
243       - string:
244           name: OPNFV_RELENG_DEV_PATH
245           default: $WORKSPACE/
246       - string:
247           name: GIT_BASE
248           default: https://gerrit.opnfv.org/gerrit/$PROJECT
249           description: 'Git URL to use on this Jenkins Slave'
250
251     wrappers:
252       - inject:
253           properties-file: "/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO/scenario.properties"
254       - ssh-agent-wrapper
255       - build-timeout:
256           timeout: 240
257       - fix-workspace-permissions
258
259     scm:
260       - git-scm-gerrit
261
262     builders:
263       - description-setter:
264           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
265       - 'xci-verify-{phase}-macro'
266
267 # -------------------------------
268 # builder macros
269 # -------------------------------
270 - builder:
271     name: 'xci-verify-set-scenario-macro'
272     builders:
273       - shell:
274           !include-raw: ./xci-set-scenario.sh
275
276 - builder:
277     name: 'xci-verify-deploy-macro'
278     builders:
279       - shell:
280           !include-raw: ./xci-start-new-vm.sh
281
282       - shell:
283           !include-raw: ./xci-start-deployment.sh
284
285 - builder:
286     name: 'xci-verify-healthcheck-macro'
287     builders:
288       - shell:
289           !include-raw: ./xci-run-functest.sh