Add fuel@x86 and fuel@arm support
[releng.git] / jjb / xci / xci-verify-jobs.yml
1 - project:
2     name: 'opnfv-xci-verify'
3
4     project: releng-xci
5 #--------------------------------
6 # branches
7 #--------------------------------
8     stream:
9         - master:
10             branch: '{stream}'
11 #--------------------------------
12 # distros
13 #--------------------------------
14     distro:
15         - ubuntu:
16             disabled: false
17             successful: false
18             failed: false
19             unstable: false
20             notbuilt: false
21         - centos:
22             disabled: false
23             successful: true
24             failed: true
25             unstable: true
26             notbuilt: true
27         - opensuse:
28             disabled: false
29             successful: false
30             failed: false
31             unstable: false
32             notbuilt: false
33 #--------------------------------
34 # type
35 #--------------------------------
36     type:
37         - virtual
38 #--------------------------------
39 # patch verification phases
40 #--------------------------------
41     phase:
42         - 'deploy'
43         - 'healthcheck'
44 #--------------------------------
45 # jobs
46 #--------------------------------
47     jobs:
48         - 'xci-verify-{distro}-{type}-{stream}'
49         - 'xci-verify-{distro}-{phase}-{type}-{stream}'
50 #--------------------------------
51 # job templates
52 #--------------------------------
53 - job-template:
54     name: 'xci-verify-{distro}-{type}-{stream}'
55
56     project-type: multijob
57
58     disabled: '{obj:disabled}'
59
60     concurrent: true
61
62     properties:
63         - logrotate-default
64         - build-blocker:
65             use-build-blocker: true
66             blocking-jobs:
67                 - 'xci-verify-{distro}-.*'
68                 - 'bifrost-verify-{distro}-.*'
69                 - 'bifrost-periodic-{distro}-.*'
70                 - 'osa-verify-{distro}-.*'
71                 - 'osa-periodic-{distro}-.*'
72             block-level: 'NODE'
73         - throttle:
74             max-per-node: 2
75             max-total: 10
76             categories:
77                 - xci-verify-virtual
78             option: category
79
80     wrappers:
81         - ssh-agent-wrapper
82         - build-timeout:
83             timeout: 240
84         - fix-workspace-permissions
85
86     scm:
87         - git-scm-gerrit
88
89     triggers:
90         - gerrit:
91             server-name: 'gerrit.opnfv.org'
92             trigger-on:
93                 - patchset-created-event:
94                     exclude-drafts: 'false'
95                     exclude-trivial-rebase: 'false'
96                     exclude-no-code-change: 'true'
97                 - draft-published-event
98                 - comment-added-contains-event:
99                     comment-contains-value: 'recheck'
100                 - comment-added-contains-event:
101                     comment-contains-value: 'reverify'
102             projects:
103               - project-compare-type: 'ANT'
104                 project-pattern: '{project}'
105                 branches:
106                   - branch-compare-type: 'ANT'
107                     branch-pattern: '**/{branch}'
108                 disable-strict-forbidden-file-verification: 'true'
109                 file-paths:
110                   - compare-type: ANT
111                     pattern: 'bifrost/**'
112                   - compare-type: ANT
113                     pattern: 'xci/**'
114                 forbidden-file-paths:
115                   - compare-type: ANT
116                     pattern: 'prototypes/**'
117                   - compare-type: ANT
118                     pattern: 'upstream/**'
119                   - compare-type: ANT
120                     pattern: '**/README.rst'
121                   - compare-type: ANT
122                     pattern: 'docs/**'
123             readable-message: true
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: '{project}'
133             branch: '{branch}'
134         - label:
135             name: SLAVE_LABEL
136             default: 'xci-virtual'
137         - string:
138             name: CLEAN_DIB_IMAGES
139             default: 'true'
140         - string:
141             name: GIT_BASE
142             default: https://gerrit.opnfv.org/gerrit/$PROJECT
143             description: 'Git URL to use on this Jenkins Slave'
144
145     builders:
146         - description-setter:
147             description: "Built on $NODE_NAME"
148         - multijob:
149             name: deploy
150             condition: SUCCESSFUL
151             projects:
152                 - name: 'xci-verify-{distro}-deploy-{type}-{stream}'
153                   current-parameters: true
154                   predefined-parameters: |
155                     DISTRO={distro}
156                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
157                     CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
158                     GERRIT_BRANCH=$GERRIT_BRANCH
159                     GERRIT_REFSPEC=$GERRIT_REFSPEC
160                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
161                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
162                   node-parameters: true
163                   kill-phase-on: FAILURE
164                   abort-all-job: true
165         - multijob:
166             name: healthcheck
167             condition: SUCCESSFUL
168             projects:
169                 - name: 'xci-verify-{distro}-healthcheck-{type}-{stream}'
170                   current-parameters: true
171                   predefined-parameters: |
172                     DISTRO={distro}
173                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
174                     CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
175                     FUNCTEST_MODE=tier
176                     FUNCTEST_TIER=healthcheck
177                     GERRIT_BRANCH=$GERRIT_BRANCH
178                     GERRIT_REFSPEC=$GERRIT_REFSPEC
179                     GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
180                     GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
181                   node-parameters: true
182                   kill-phase-on: NEVER
183                   abort-all-job: true
184
185 - job-template:
186     name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
187
188     disabled: false
189
190     concurrent: true
191
192     properties:
193         - logrotate-default
194         - build-blocker:
195             use-build-blocker: true
196             blocking-jobs:
197                 - 'bifrost-verify-.*'
198                 - 'bifrost-periodic-.*'
199                 - 'osa-verify-.*'
200                 - 'osa-periodic-.*'
201             block-level: 'NODE'
202
203     parameters:
204         - string:
205             name: PROJECT
206             default: 'releng-xci'
207         - string:
208             name: DISTRO
209             default: 'ubuntu'
210         - string:
211             name: DEPLOY_SCENARIO
212             default: 'os-nosdn-nofeature-noha'
213         - string:
214             name: FUNCTEST_MODE
215             default: 'tier'
216         - string:
217             name: FUNCTEST_SUITE_NAME
218             default: 'healthcheck'
219         - string:
220             name: XCI_FLAVOR
221             default: 'mini'
222         - string:
223             name: CLEAN_DIB_IMAGES
224             default: 'true'
225         - string:
226             name: OPNFV_RELENG_DEV_PATH
227             default: $WORKSPACE/
228         - string:
229             name: INSTALLER_TYPE
230             default: 'osa'
231         - string:
232             name: GIT_BASE
233             default: https://gerrit.opnfv.org/gerrit/$PROJECT
234             description: 'Git URL to use on this Jenkins Slave'
235
236     wrappers:
237         - ssh-agent-wrapper
238         - build-timeout:
239             timeout: 240
240         - fix-workspace-permissions
241
242     scm:
243         - git-scm-gerrit
244
245     builders:
246         - description-setter:
247             description: "Built on $NODE_NAME"
248         - 'xci-verify-{phase}-macro'
249
250 #--------------------------------
251 # builder macros
252 #--------------------------------
253 - builder:
254     name: 'xci-verify-deploy-macro'
255     builders:
256         - shell: |
257             #!/bin/bash
258
259             # skip the deployment if the patch doesn't impact the deployment
260             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
261                 echo "Skipping the deployment!"
262                 exit 0
263             fi
264
265             cd $WORKSPACE
266
267             # The start-new-vm.sh script will copy the entire releng-xci directory
268             # so lets prepare the test script now so it can be copied by the script.
269             # Please do not move it elsewhere or you would have to move it to the VM
270             # yourself.
271             cat > xci_test.sh<<EOF
272             #!/bin/bash
273             export DISTRO=$DISTRO
274             export DEPLOY_SCENARIO=$DEPLOY_SCENARIO
275             export FUNCTEST_MODE=$FUNCTEST_MODE
276             export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
277             export XCI_FLAVOR=$XCI_FLAVOR
278             export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
279             export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/
280             export INSTALLER_TYPE=$INSTALLER_TYPE
281             export GIT_BASE=$GIT_BASE
282             export JENKINS_HOME=$JENKINS_HOME
283
284             cd xci
285             ./xci-deploy.sh
286             EOF
287             chmod a+x xci_test.sh
288
289             ./xci/scripts/vm/start-new-vm.sh $DISTRO
290         - shell: |
291             #!/bin/bash
292
293             # skip the deployment if the patch doesn't impact the deployment
294             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
295                 echo "Skipping the deployment!"
296                 exit 0
297             fi
298
299             ssh ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh"
300
301
302 - builder:
303     name: 'xci-verify-healthcheck-macro'
304     builders:
305         - shell: |
306             #!/bin/bash
307
308             # skip the healthcheck if the patch doesn't impact the deployment
309             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
310                 echo "Skipping the healthcheck!"
311                 exit 0
312             fi
313
314             echo "Hello World!"
315         - shell: |
316             #!/bin/bash
317
318             # skip the deployment if the patch doesn't impact the deployment
319             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
320                 echo "Skipping the deployment!"
321                 exit 0
322             fi
323
324             sudo virsh destroy ${DISTRO}_xci_vm
325             sudo virsh undefine ${DISTRO}_xci_vm
326
327 # this will be enabled once the xci is prepared
328 #- builder:
329 #    name: 'xci-verify-healthcheck-macro'
330 #    builders:
331 #        - shell:
332 #            !include-raw: ../../utils/fetch_os_creds.sh
333 #        - shell:
334 #            !include-raw: ../functest/functest-alpine.sh