jjb: xci: Use core OpenStack installation by default
[releng.git] / jjb / xci / osa-periodic-jobs.yml
1 ---
2 - project:
3     name: 'opnfv-osa-periodic'
4
5     project: openstack-ansible
6     # -------------------------------
7     # branches
8     # -------------------------------
9     stream:
10       - master:
11           branch: '{stream}'
12     # -------------------------------
13     # distros
14     # -------------------------------
15     distro:
16       - ubuntu:
17           disabled: false
18       - centos:
19           disabled: false
20       - opensuse:
21           disabled: false
22     # -------------------------------
23     # type
24     # -------------------------------
25     type:
26       - virtual
27     # -------------------------------
28     # periodic deploy & test phases
29     # -------------------------------
30     phase:
31       - 'deploy'
32       - 'healthcheck'
33     # -------------------------------
34     # jobs
35     # -------------------------------
36     jobs:
37       - 'xci-osa-periodic-{distro}-{type}-{stream}'
38       - 'xci-osa-periodic-{distro}-{phase}-{type}-{stream}'
39 # -------------------------------
40 # job templates
41 # -------------------------------
42 - job-template:
43     name: 'xci-osa-periodic-{distro}-{type}-{stream}'
44
45     project-type: multijob
46
47     disabled: '{obj:disabled}'
48
49     concurrent: true
50
51     properties:
52       - logrotate-default
53       - build-blocker:
54           use-build-blocker: true
55           blocking-jobs:
56             - 'xci-verify-{distro}-.*'
57             - 'bifrost-verify-{distro}-.*'
58             - 'bifrost-periodic-{distro}-.*'
59             - 'xci-osa-verify-{distro}-.*'
60             - 'xci-osa-periodic-{distro}-.*'
61           block-level: 'NODE'
62       - throttle:
63           max-per-node: 2
64           max-total: 10
65           categories:
66             - xci-verify-virtual
67           option: category
68
69     wrappers:
70       - ssh-agent-wrapper
71       - build-timeout:
72           timeout: 240
73       - fix-workspace-permissions
74
75     scm:
76       - git-scm-openstack
77
78     parameters:
79       - project-parameter:
80           project: '{project}'
81           branch: '{branch}'
82       - label:
83           name: SLAVE_LABEL
84           default: 'xci-virtual'
85       - string:
86           name: OPENSTACK_OSA_VERSION
87           default: 'master'
88       - string:
89           name: CLEAN_DIB_IMAGES
90           default: 'true'
91       - string:
92           name: GIT_BASE
93           default: 'https://git.openstack.org/openstack/$PROJECT'
94           description: 'Git URL to use on this Jenkins Slave'
95
96     builders:
97       - description-setter:
98           description: "Built on $NODE_NAME"
99       - multijob:
100           name: deploy
101           condition: SUCCESSFUL
102           projects:
103             - name: 'xci-osa-periodic-{distro}-deploy-{type}-{stream}'
104               current-parameters: true
105               predefined-parameters: |
106                 DISTRO={distro}
107                 DEPLOY_SCENARIO=os-nosdn-nofeature-noha
108                 OPENSTACK_OSA_VERSION=$OPENSTACK_OSA_VERSION
109                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
110                 BRANCH=$BRANCH
111               node-parameters: true
112               kill-phase-on: FAILURE
113               abort-all-job: true
114               git-revision: true
115       - multijob:
116           name: healthcheck
117           condition: SUCCESSFUL
118           projects:
119             - name: 'xci-osa-periodic-{distro}-healthcheck-{type}-{stream}'
120               current-parameters: true
121               predefined-parameters: |
122                 DISTRO={distro}
123                 DEPLOY_SCENARIO=os-nosdn-nofeature-noha
124                 OPENSTACK_OSA_VERSION=$OPENSTACK_OSA_VERSION
125                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
126                 FUNCTEST_MODE=tier
127                 FUNCTEST_TIER=healthcheck
128                 BRANCH=$BRANCH
129               node-parameters: true
130               kill-phase-on: NEVER
131               abort-all-job: true
132
133 - job-template:
134     name: 'xci-osa-periodic-{distro}-{phase}-{type}-{stream}'
135
136     disabled: false
137
138     concurrent: true
139
140     properties:
141       - logrotate-default
142       - build-blocker:
143           use-build-blocker: true
144           blocking-jobs:
145             - '.*-bifrost-verify-.*'
146             - '.*-bifrost-periodic-.*'
147           block-level: 'NODE'
148
149     parameters:
150       - project-parameter:
151           project: '{project}'
152           branch: '{branch}'
153       - string:
154           name: DISTRO
155           default: 'ubuntu'
156       - string:
157           name: DEPLOY_SCENARIO
158           default: 'os-nosdn-nofeature-noha'
159       - string:
160           name: OPENSTACK_OSA_VERSION
161           default: 'master'
162       - string:
163           name: FUNCTEST_MODE
164           default: 'tier'
165       - string:
166           name: FUNCTEST_SUITE_NAME
167           default: 'healthcheck'
168       - string:
169           name: XCI_FLAVOR
170           default: 'mini'
171       - string:
172           name: CLEAN_DIB_IMAGES
173           default: 'true'
174       - string:
175           name: INSTALLER_TYPE
176           default: 'osa'
177       - string:
178           name: GIT_BASE
179           default: 'https://git.openstack.org/openstack/$PROJECT'
180           description: 'Git URL to use on this Jenkins Slave'
181
182     wrappers:
183       - ssh-agent-wrapper
184       - build-timeout:
185           timeout: 240
186       - fix-workspace-permissions
187
188     scm:
189       - git-scm-openstack
190
191     builders:
192       - description-setter:
193           description: "Built on $NODE_NAME"
194       - 'xci-osa-periodic-{phase}-macro'
195
196 # -------------------------------
197 # builder macros
198 # -------------------------------
199 - builder:
200     name: 'xci-osa-periodic-deploy-macro'
201     builders:
202       - shell: |
203           #!/bin/bash
204
205           cd $WORKSPACE
206
207           # The start-new-vm.sh script will copy the entire releng-xci directory
208           # so lets prepare the test script now so it can be copied by the script.
209           # Please do not move it elsewhere or you would have to move it to the VM
210           # yourself.
211           cat > xci_test.sh<<EOF
212           #!/bin/bash
213           export DISTRO=$DISTRO
214           export DEPLOY_SCENARIO=$DEPLOY_SCENARIO
215           export OPENSTACK_OSA_VERSION=$OPENSTACK_OSA_VERSION
216           export FUNCTEST_MODE=$FUNCTEST_MODE
217           export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
218           export XCI_FLAVOR=$XCI_FLAVOR
219           export CORE_OPENSTACK_INSTALL=true
220           export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
221           export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/
222           export INSTALLER_TYPE=$INSTALLER_TYPE
223           export GIT_BASE=$GIT_BASE
224           export JENKINS_HOME=$JENKINS_HOME
225
226           cd xci
227           ./xci-deploy.sh
228           EOF
229           chmod a+x xci_test.sh
230
231           export XCI_BUILD_CLEAN_VM_OS=false
232           export XCI_UPDATE_CLEAN_VM_OS=true
233
234           ./xci/scripts/vm/start-new-vm.sh $DISTRO
235       - shell: |
236           #!/bin/bash
237
238           ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh"
239
240
241 - builder:
242     name: 'xci-osa-periodic-healthcheck-macro'
243     builders:
244       - shell: |
245           #!/bin/bash
246
247           echo "Hello World!"
248       - shell: |
249           #!/bin/bash
250
251           sudo virsh destroy ${DISTRO}_xci_vm || true
252           sudo virsh undefine ${DISTRO}_xci_vm || true
253
254 # this will be enabled once the xci is prepared
255 # - builder:
256 #    name: 'xci-verify-healthcheck-macro'
257 #    builders:
258 #        - shell:
259 #            !include-raw: ../../utils/fetch_os_creds.sh
260 #        - shell:
261 #            !include-raw: ../functest/functest-alpine.sh