infra: Remove /opt/stack to prevent leftovers from causing trouble
[releng.git] / jjb / infra / openstack-bifrost-verify.sh
1 #!/bin/bash
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2016 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 set -o errexit
11 set -o nounset
12 set -o pipefail
13
14 # check distro to see if we support it
15 # we will have centos and suse supported in future
16 case "$DISTRO" in
17     trusty)
18         #start the test
19         echo "Starting provisioning of 3 VMs"
20         ;;
21     *)
22         echo "Distro $DISTRO is not supported!"
23         exit 1
24 esac
25
26 # remove previously cloned repos
27 /bin/rm -rf /opt/bifrost /opt/puppet-infracloud /opt/stack /opt/releng
28
29 # clone upstream bifrost repo and checkout the patch to verify
30 git clone https://git.openstack.org/openstack/bifrost /opt/bifrost
31 cd /opt/bifrost
32 git fetch https://git.openstack.org/openstack/bifrost $GERRIT_REFSPEC && git checkout FETCH_HEAD
33
34 # clone puppet-infracloud
35 git clone https://git.openstack.org/openstack-infra/puppet-infracloud /opt/puppet-infracloud
36
37 # combine opnfv and upstream scripts/playbooks
38 cp -R $WORKSPACE/prototypes/bifrost/* /opt/bifrost/
39
40 # cleanup remnants of previous deployment
41 cd /opt/bifrost
42 ./scripts/destroy-env.sh
43
44 # provision 3 VMs; jumphost, controller, and compute
45 cd /opt/bifrost
46 ./scripts/test-bifrost-deployment.sh
47
48 # list the provisioned VMs
49 cd /opt/bifrost
50 source env-vars
51 ironic node-list
52 virsh list