xci: Fix XCI_DISTRO vars and remove clean_vm cleanup steps
[releng.git] / jjb / xci / xci-daily-jobs.yaml
1 ---
2 - project:
3     project: 'releng-xci'
4
5     name: 'xci-daily'
6
7     # -------------------------------
8     # Branch Anchors
9     # -------------------------------
10     master: &master
11       stream: master
12       opnfv-releng-version: master
13       gs-pathname: ''
14
15     # -------------------------------
16     # Scenarios
17     # -------------------------------
18     scenario:
19       - 'os-nosdn-nofeature-noha':
20           auto-trigger-name: 'daily-trigger-disabled'
21           deploy-scenario: 'os-nosdn-nofeature'
22           installer-type: 'osa'
23           xci-flavor: 'mini'
24       - 'os-odl-sfc-noha':
25           auto-trigger-name: 'daily-trigger-disabled'
26           deploy-scenario: 'os-odl-sfc'
27           installer-type: 'osa'
28           xci-flavor: 'mini'
29
30     # -------------------------------
31     # XCI PODs
32     # -------------------------------
33     pod:
34       - virtual:
35           <<: *master
36
37     # -------------------------------
38     # Supported Distros
39     # -------------------------------
40     distro:
41       - 'ubuntu':
42           disabled: false
43           slave-label: xci-virtual
44       - 'centos':
45           disabled: true
46           slave-label: xci-virtual
47       - 'opensuse':
48           disabled: false
49           slave-label: xci-virtual
50
51     # -------------------------------
52     #        Phases
53     # -------------------------------
54     phase:
55       - 'deploy'
56       - 'functest'
57
58     # -------------------------------
59     # jobs
60     # -------------------------------
61     jobs:
62       - 'xci-{scenario}-{pod}-{distro}-daily-{stream}'
63       - 'xci-{phase}-{pod}-{distro}-daily-{stream}'
64
65 # -------------------------------
66 # job templates
67 # -------------------------------
68 - job-template:
69     name: 'xci-{scenario}-{pod}-{distro}-daily-{stream}'
70
71     disabled: '{obj:disabled}'
72
73     concurrent: false
74
75     properties:
76       - build-blocker:
77           use-build-blocker: true
78           blocking-jobs:
79             - '^xci-verify.*'
80             - '^xci-os.*'
81             - '^xci-deploy.*'
82             - '^xci-functest.*'
83             - '^bifrost-.*periodic.*'
84             - '^osa-.*periodic.*'
85           block-level: 'NODE'
86       - logrotate-default
87
88     parameters:
89       - string:
90           name: DEPLOY_SCENARIO
91           default: '{deploy-scenario}'
92       - string:
93           name: INSTALLER_TYPE
94           default: '{installer-type}'
95       - string:
96           name: XCI_FLAVOR
97           default: '{xci-flavor}'
98       - label:
99           name: SLAVE_LABEL
100           default: '{slave-label}'
101       - string:
102           name: XCI_DISTRO
103           default: '{distro}'
104       - string:
105           name: FUNCTEST_MODE
106           default: 'tier'
107       - string:
108           name: FUNCTEST_SUITE_NAME
109           default: 'healthcheck'
110       - string:
111           name: CI_LOOP
112           default: 'daily'
113       - string:
114           name: GIT_BASE
115           default: https://gerrit.opnfv.org/gerrit/$PROJECT
116           description: 'Git URL to use on this Jenkins Slave'
117
118     triggers:
119       - '{auto-trigger-name}'
120
121     wrappers:
122       - ssh-agent-wrapper
123       - build-timeout:
124           timeout: 240
125       - fix-workspace-permissions
126
127     builders:
128       - description-setter:
129           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
130       - trigger-builds:
131           - project: 'xci-deploy-{pod}-{distro}-daily-{stream}'
132             current-parameters: false
133             predefined-parameters: |
134               DEPLOY_SCENARIO=$DEPLOY_SCENARIO
135               INSTALLER_TYPE=$INSTALLER_TYPE
136               XCI_FLAVOR=$XCI_FLAVOR
137               CI_LOOP=$CI_LOOP
138               XCI_DISTRO=$XCI_DISTRO
139             same-node: true
140             block: true
141       - trigger-builds:
142           - project: 'xci-functest-{pod}-{distro}-daily-{stream}'
143             current-parameters: false
144             predefined-parameters: |
145               DEPLOY_SCENARIO=$DEPLOY_SCENARIO
146               INSTALLER_TYPE=$INSTALLER_TYPE
147               XCI_FLAVOR=$XCI_FLAVOR
148               CI_LOOP=$CI_LOOP
149               XCI_DISTRO=$XCI_DISTRO
150               FUNCTEST_MODE=$FUNCTEST_MODE
151               FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
152             same-node: true
153             block: true
154             block-thresholds:
155               build-step-failure-threshold: 'never'
156               failure-threshold: 'never'
157               unstable-threshold: 'FAILURE'
158
159     publishers:
160       # yamllint disable rule:line-length
161       # yamllint enable rule:line-length
162       - email-jenkins-admins-on-failure
163
164 - job-template:
165     name: 'xci-{phase}-{pod}-{distro}-daily-{stream}'
166
167     disabled: false
168
169     concurrent: true
170
171     properties:
172       - build-blocker:
173           use-build-blocker: true
174           blocking-jobs:
175             - '^xci-verify.*'
176             - '^xci-deploy.*'
177             - '^xci-functest.*'
178             - '^bifrost-.*periodic.*'
179             - '^osa-.*periodic.*'
180           block-level: 'NODE'
181       - throttle:
182           enabled: true
183           max-per-node: 1
184           option: 'project'
185       - logrotate-default
186
187     wrappers:
188       - ssh-agent-wrapper
189       - build-timeout:
190           timeout: 240
191       - fix-workspace-permissions
192
193     scm:
194       - git-scm
195
196     parameters:
197       - project-parameter:
198           project: '{project}'
199           branch: '{opnfv-releng-version}'
200       - string:
201           name: DEPLOY_SCENARIO
202           default: 'os-nosdn-nofeature-noha'
203       - string:
204           name: INSTALLER_TYPE
205           default: 'osa'
206       - string:
207           name: XCI_FLAVOR
208           default: 'mini'
209       - string:
210           name: XCI_DISTRO
211           default: 'ubuntu'
212       - label:
213           name: SLAVE_LABEL
214           default: '{slave-label}'
215       - string:
216           name: FUNCTEST_MODE
217           default: 'tier'
218       - string:
219           name: FUNCTEST_SUITE_NAME
220           default: 'healthcheck'
221       - string:
222           name: CI_LOOP
223           default: 'daily'
224       - string:
225           name: GIT_BASE
226           default: https://gerrit.opnfv.org/gerrit/$PROJECT
227
228     builders:
229       - description-setter:
230           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
231       - 'xci-daily-{phase}-macro'
232
233 # --------------------------
234 # builder macros
235 # --------------------------
236 - builder:
237     name: 'xci-daily-deploy-macro'
238     builders:
239       - shell: |
240           #!/bin/bash
241           set -o errexit
242           set -o pipefail
243
244           cd $WORKSPACE/xci && ./xci-deploy.sh
245
246 - builder:
247     name: 'xci-daily-functest-macro'
248     builders:
249       - shell: |
250           #!/bin/bash
251           set -o errexit
252           set -o pipefail
253
254           echo "Prepare OPNFV VM for Functest"
255           echo "---------------------------------------------------------------------------------"
256           export XCI_PATH=$WORKSPACE
257           export XCI_VENV=${XCI_PATH}/venv
258           source $XCI_VENV/bin/activate
259           while read var; do
260               declare -x "\${var}" 2>/dev/null
261               echo $var
262           done < ${XCI_PATH}/.cache/xci.env && cd $XCI_PATH/xci && \
263           ansible-playbook -i playbooks/dynamic_inventory.py playbooks/prepare-functest.yml
264
265           echo "Run Functest"
266           echo "---------------------------------------------------------------------------------"
267           ssh root@192.168.122.2 "/root/run-functest.sh"