Merge "Adding a new verification job for testapi UI."
[releng.git] / jjb / xci / osa-periodic-jobs.yaml
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           blocking-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           all-nodes: false
86           node-eligibility: 'ignore-offline'
87       - string:
88           name: OPENSTACK_OSA_VERSION
89           default: 'master'
90       - string:
91           name: CLEAN_DIB_IMAGES
92           default: 'true'
93       - string:
94           name: GIT_BASE
95           default: 'https://git.openstack.org/openstack/$PROJECT'
96           description: 'Git URL to use on this Jenkins Slave'
97
98     builders:
99       - description-setter:
100           description: "Built on $NODE_NAME"
101       - multijob:
102           name: deploy
103           condition: SUCCESSFUL
104           projects:
105             - name: 'xci-osa-periodic-{distro}-deploy-{type}-{stream}'
106               current-parameters: true
107               predefined-parameters: |
108                 DISTRO={distro}
109                 DEPLOY_SCENARIO=os-nosdn-nofeature-noha
110                 OPENSTACK_OSA_VERSION=$OPENSTACK_OSA_VERSION
111                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
112                 BRANCH=$BRANCH
113               node-parameters: true
114               kill-phase-on: FAILURE
115               abort-all-job: true
116               git-revision: true
117       - multijob:
118           name: healthcheck
119           condition: SUCCESSFUL
120           projects:
121             - name: 'xci-osa-periodic-{distro}-healthcheck-{type}-{stream}'
122               current-parameters: true
123               predefined-parameters: |
124                 DISTRO={distro}
125                 DEPLOY_SCENARIO=os-nosdn-nofeature-noha
126                 OPENSTACK_OSA_VERSION=$OPENSTACK_OSA_VERSION
127                 CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
128                 FUNCTEST_MODE=tier
129                 FUNCTEST_TIER=healthcheck
130                 BRANCH=$BRANCH
131               node-parameters: true
132               kill-phase-on: NEVER
133               abort-all-job: true
134
135 - job-template:
136     name: 'xci-osa-periodic-{distro}-{phase}-{type}-{stream}'
137
138     disabled: false
139
140     concurrent: true
141
142     properties:
143       - logrotate-default
144       - build-blocker:
145           use-build-blocker: true
146           blocking-jobs:
147             - '.*-bifrost-verify-.*'
148             - '.*-bifrost-periodic-.*'
149           blocking-level: 'NODE'
150
151     parameters:
152       - project-parameter:
153           project: '{project}'
154           branch: '{branch}'
155       - string:
156           name: DISTRO
157           default: 'ubuntu'
158       - string:
159           name: DEPLOY_SCENARIO
160           default: 'os-nosdn-nofeature-noha'
161       - string:
162           name: OPENSTACK_OSA_VERSION
163           default: 'master'
164       - string:
165           name: FUNCTEST_MODE
166           default: 'tier'
167       - string:
168           name: FUNCTEST_SUITE_NAME
169           default: 'healthcheck'
170       - string:
171           name: XCI_FLAVOR
172           default: 'mini'
173       - string:
174           name: CLEAN_DIB_IMAGES
175           default: 'true'
176       - string:
177           name: INSTALLER_TYPE
178           default: 'osa'
179       - string:
180           name: GIT_BASE
181           default: 'https://git.openstack.org/openstack/$PROJECT'
182           description: 'Git URL to use on this Jenkins Slave'
183
184     wrappers:
185       - ssh-agent-wrapper
186       - build-timeout:
187           timeout: 240
188       - fix-workspace-permissions
189
190     scm:
191       - git-scm-openstack
192
193     builders:
194       - description-setter:
195           description: "Built on $NODE_NAME"
196       - 'xci-osa-periodic-{phase}-macro'
197
198 # -------------------------------
199 # builder macros
200 # -------------------------------
201 - builder:
202     name: 'xci-osa-periodic-deploy-macro'
203     builders:
204       - shell: |
205           #!/bin/bash
206
207           cd $WORKSPACE
208
209           # The start-new-vm.sh script will copy the entire releng-xci directory
210           # so lets prepare the test script now so it can be copied by the script.
211           # Please do not move it elsewhere or you would have to move it to the VM
212           # yourself.
213           cat > xci_test.sh<<EOF
214           #!/bin/bash
215           export DISTRO=$DISTRO
216           export DEPLOY_SCENARIO=$DEPLOY_SCENARIO
217           export OPENSTACK_OSA_VERSION=$OPENSTACK_OSA_VERSION
218           export FUNCTEST_MODE=$FUNCTEST_MODE
219           export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
220           export XCI_FLAVOR=$XCI_FLAVOR
221           export CORE_OPENSTACK_INSTALL=true
222           export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES
223           export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/
224           export INSTALLER_TYPE=$INSTALLER_TYPE
225           export GIT_BASE=$GIT_BASE
226           export JENKINS_HOME=$JENKINS_HOME
227
228           cd xci
229           ./xci-deploy.sh
230           EOF
231           chmod a+x xci_test.sh
232
233           export XCI_BUILD_CLEAN_VM_OS=false
234           export XCI_UPDATE_CLEAN_VM_OS=true
235
236           ./xci/scripts/vm/start-new-vm.sh $DISTRO
237       - shell: |
238           #!/bin/bash
239
240           ssh -F $HOME/.ssh/${DISTRO}-xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh"
241
242
243 - builder:
244     name: 'xci-osa-periodic-healthcheck-macro'
245     builders:
246       - shell: |
247           #!/bin/bash
248
249           echo "Hello World!"
250       - shell: |
251           #!/bin/bash
252
253           sudo virsh destroy ${DISTRO}_xci_vm || true
254           sudo virsh undefine ${DISTRO}_xci_vm || true
255
256 # this will be enabled once the xci is prepared
257 # - builder:
258 #    name: 'xci-verify-healthcheck-macro'
259 #    builders:
260 #        - shell:
261 #            !include-raw: ../../utils/fetch_os_creds.sh
262 #        - shell:
263 #            !include-raw: ../functest/functest-alpine.sh