Gary Wu | 874794d | 2017-10-13 12:27:39 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Gary Wu | 874794d | 2017-10-13 12:27:39 -0700 | [diff] [blame] | 3 | if [ -z "$WORKSPACE" ]; then |
| 4 | export WORKSPACE=`git rev-parse --show-toplevel` |
| 5 | fi |
| 6 | |
Gary Wu | 838c34d | 2017-10-23 14:22:40 -0700 | [diff] [blame] | 7 | source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh |
Gary Wu | 874794d | 2017-10-13 12:27:39 -0700 | [diff] [blame] | 8 | |
Gary Wu | 99a7c1a | 2017-10-23 13:12:06 -0700 | [diff] [blame] | 9 | # Delete all existing stacks |
| 10 | STACKS=$(openstack stack list -c "Stack Name" -f value) |
Gary Wu | bd89460 | 2017-10-30 11:52:40 -0700 | [diff] [blame^] | 11 | if [ ! -z "${STACKS}" ]; then |
| 12 | echo "Deleting Stacks ${STACKS}" |
| 13 | openstack stack delete -y $STACKS |
| 14 | else |
| 15 | echo "No existing stacks to delete." |
| 16 | fi |
Gary Wu | 874794d | 2017-10-13 12:27:39 -0700 | [diff] [blame] | 17 | |
| 18 | STACK="ete-$(uuidgen | cut -c-8)" |
Gary Wu | 99a7c1a | 2017-10-23 13:12:06 -0700 | [diff] [blame] | 19 | echo "New Stack Name: ${STACK}" |
Gary Wu | b84428e | 2017-10-30 11:09:27 -0700 | [diff] [blame] | 20 | |
| 21 | |
Gary Wu | bd89460 | 2017-10-30 11:52:40 -0700 | [diff] [blame^] | 22 | cp ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.env ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-demo.env |
Gary Wu | b84428e | 2017-10-30 11:09:27 -0700 | [diff] [blame] | 23 | envsubst < ${WORKSPACE}/test/ete/labs/windriver/onap-openstack-template.env > ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env |
| 24 | |
Gary Wu | a770e64 | 2017-10-23 12:30:29 -0700 | [diff] [blame] | 25 | openstack stack create -t ${ONAP_WORKDIR}/demo/heat/ONAP/onap_openstack.yaml -e ${WORKSPACE}/test/ete/labs/windriver/onap-openstack.env $STACK |
Gary Wu | 874794d | 2017-10-13 12:27:39 -0700 | [diff] [blame] | 26 | |