jjb: xci: xci-verify-jobs: Fix XCI VM names
[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         - 'centos':
18             disabled: true
19         - 'opensuse':
20             disabled: true
21 #--------------------------------
22 # type
23 #--------------------------------
24     type:
25         - virtual
26 #--------------------------------
27 # patch verification phases
28 #--------------------------------
29     phase:
30         - 'deploy'
31         - 'healthcheck'
32 #--------------------------------
33 # jobs
34 #--------------------------------
35     jobs:
36         - 'xci-verify-{distro}-{type}-{stream}'
37         - 'xci-verify-{phase}-{type}-{stream}'
38 #--------------------------------
39 # job templates
40 #--------------------------------
41 - job-template:
42     name: 'xci-verify-{distro}-{type}-{stream}'
43
44     project-type: multijob
45
46     disabled: '{obj:disabled}'
47
48     concurrent: true
49
50     properties:
51         - logrotate-default
52         - build-blocker:
53             use-build-blocker: true
54             blocking-jobs:
55                 - 'xci-verify-{distro}-.*'
56                 - 'bifrost-verify-{distro}-.*'
57                 - 'bifrost-periodic-{distro}-.*'
58                 - 'osa-verify-{distro}-.*'
59                 - 'osa-periodic-{distro}-.*'
60             block-level: 'NODE'
61
62     wrappers:
63         - ssh-agent-wrapper
64         - build-timeout:
65             timeout: 240
66         - fix-workspace-permissions
67
68     scm:
69         - git-scm-gerrit
70
71     triggers:
72         - gerrit:
73             server-name: 'gerrit.opnfv.org'
74             trigger-on:
75                 - patchset-created-event:
76                     exclude-drafts: 'false'
77                     exclude-trivial-rebase: 'false'
78                     exclude-no-code-change: 'true'
79                 - draft-published-event
80                 - comment-added-contains-event:
81                     comment-contains-value: 'recheck'
82                 - comment-added-contains-event:
83                     comment-contains-value: 'reverify'
84             projects:
85               - project-compare-type: 'ANT'
86                 project-pattern: '{project}'
87                 branches:
88                   - branch-compare-type: 'ANT'
89                     branch-pattern: '**/{branch}'
90                 disable-strict-forbidden-file-verification: 'true'
91                 file-paths:
92                   - compare-type: ANT
93                     pattern: 'bifrost/**'
94                   - compare-type: ANT
95                     pattern: 'xci/**'
96                 forbidden-file-paths:
97                   - compare-type: ANT
98                     pattern: 'prototypes/**'
99                   - compare-type: ANT
100                     pattern: 'upstream/**'
101                   - compare-type: ANT
102                     pattern: '**/README.rst'
103                   - compare-type: ANT
104                     pattern: 'docs/**'
105             readable-message: true
106
107     parameters:
108         - project-parameter:
109             project: '{project}'
110             branch: '{branch}'
111         - label:
112             name: SLAVE_LABEL
113             default: 'xci-virtual'
114         - string:
115             name: CLEAN_DIB_IMAGES
116             default: 'true'
117         - string:
118             name: GIT_BASE
119             default: https://gerrit.opnfv.org/gerrit/$PROJECT
120             description: 'Git URL to use on this Jenkins Slave'
121
122     builders:
123         - description-setter:
124             description: "Built on $NODE_NAME"
125         - multijob:
126             name: deploy
127             condition: SUCCESSFUL
128             projects:
129                 - name: 'xci-verify-deploy-{type}-{stream}'
130                   current-parameters: true
131                   predefined-parameters: |
132                     DISTRO={distro}
133                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
134                     CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
135                   node-parameters: true
136                   kill-phase-on: FAILURE
137                   abort-all-job: true
138         - multijob:
139             name: healthcheck
140             condition: SUCCESSFUL
141             projects:
142                 - name: 'xci-verify-healthcheck-{type}-{stream}'
143                   current-parameters: true
144                   predefined-parameters: |
145                     DISTRO={distro}
146                     DEPLOY_SCENARIO=os-nosdn-nofeature-noha
147                     CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
148                     FUNCTEST_MODE=tier
149                     FUNCTEST_TIER=healthcheck
150                   node-parameters: true
151                   kill-phase-on: NEVER
152                   abort-all-job: true
153
154 - job-template:
155     name: 'xci-verify-{phase}-{type}-{stream}'
156
157     disabled: false
158
159     concurrent: true
160
161     properties:
162         - logrotate-default
163         - build-blocker:
164             use-build-blocker: true
165             blocking-jobs:
166                 - 'xci-verify-deploy-.*'
167                 - 'xci-verify-healthcheck-.*'
168                 - 'bifrost-verify-.*'
169                 - 'bifrost-periodic-.*'
170                 - 'osa-verify-.*'
171                 - 'osa-periodic-.*'
172             block-level: 'NODE'
173
174     parameters:
175         - string:
176             name: DISTRO
177             default: 'ubuntu'
178         - string:
179             name: DEPLOY_SCENARIO
180             default: 'os-nosdn-nofeature-noha'
181         - string:
182             name: FUNCTEST_MODE
183             default: 'tier'
184         - string:
185             name: FUNCTEST_SUITE_NAME
186             default: 'healthcheck'
187         - string:
188             name: XCI_FLAVOR
189             default: 'mini'
190         - string:
191             name: CLEAN_DIB_IMAGES
192             default: 'true'
193         - string:
194             name: OPNFV_RELENG_DEV_PATH
195             default: $WORKSPACE/
196         - string:
197             name: INSTALLER_TYPE
198             default: 'osa'
199         - string:
200             name: GIT_BASE
201             default: https://gerrit.opnfv.org/gerrit/$PROJECT
202             description: 'Git URL to use on this Jenkins Slave'
203
204     wrappers:
205         - ssh-agent-wrapper
206         - build-timeout:
207             timeout: 240
208         - fix-workspace-permissions
209
210     scm:
211         - git-scm-gerrit
212
213     builders:
214         - description-setter:
215             description: "Built on $NODE_NAME for $DISTRO"
216         - 'xci-verify-{phase}-macro'
217
218 #--------------------------------
219 # builder macros
220 #--------------------------------
221 - builder:
222     name: 'xci-verify-deploy-macro'
223     builders:
224         - shell: |
225             #!/bin/bash
226
227             # skip the deployment if the patch doesn't impact the deployment
228             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
229                 echo "Skipping the deployment!"
230                 exit 0
231             fi
232
233             cd $WORKSPACE
234             ./xci/scripts/vm/start-new-vm.sh $DISTRO
235         - shell: |
236             #!/bin/bash
237
238             # skip the deployment if the patch doesn't impact the deployment
239             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
240                 echo "Skipping the deployment!"
241                 exit 0
242             fi
243
244             ssh ${DISTRO}_xci_vm "cd releng-xci/xci && ./xci-deploy.sh"
245
246
247 - builder:
248     name: 'xci-verify-healthcheck-macro'
249     builders:
250         - shell: |
251             #!/bin/bash
252
253             # skip the healthcheck if the patch doesn't impact the deployment
254             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
255                 echo "Skipping the healthcheck!"
256                 exit 0
257             fi
258
259             echo "Hello World!"
260         - shell: |
261             #!/bin/bash
262
263             # skip the deployment if the patch doesn't impact the deployment
264             if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
265                 echo "Skipping the deployment!"
266                 exit 0
267             fi
268
269             sudo virsh destroy ${DISTRO}_xci_vm
270             sudo virsh undefine ${DISTRO}_xci_vm
271
272 # this will be enabled once the xci is prepared
273 #- builder:
274 #    name: 'xci-verify-healthcheck-macro'
275 #    builders:
276 #        - shell:
277 #            !include-raw: ../../utils/fetch_os_creds.sh
278 #        - shell:
279 #            !include-raw: ../functest/functest-alpine.sh