zun/contrib/vagrant/install_devstack.sh
Pradeep Kumar Singh 6e3d3e414b Add vagrant file for setting devstack for Zun
This patch adds necessary files and script for setting up
a zun devstack environment through vagrant. This will help
to boost productivity of zun developers.

Implements: blueprint vagrant-support-zun
Change-Id: Iacbf777b46208d7b1d52390b9c4a3c5a4229573e
2016-12-16 03:49:48 +00:00

38 lines
876 B
Bash

#!/bin/sh
export OS_USER=vagrant
BASHPATH=$(dirname "$0"\")
echo "run script from $BASHPATH"
# update system
export DEBIAN_FRONTEND noninteractive
sudo apt-get update
sudo apt-get install -qqy git
# determine checkout folder
PWD=$(su "$OS_USER" -c "cd && pwd")
DEVSTACK=$PWD/devstack
# check if devstack is already there
if [ ! -d "$DEVSTACK" ]
then
echo "Download devstack into $DEVSTACK"
# clone devstack
su "$OS_USER" -c "cd && git clone -b master https://github.com/openstack-dev/devstack.git $DEVSTACK"
echo "Copy configuration"
# copy localrc settings (source: devstack/samples/localrc)
echo "copy config from $BASHPATH/config/localrc to $DEVSTACK/localrc"
cp "$BASHPATH"/config/localrc "$DEVSTACK"/localrc
chown "$OS_USER":"$OS_USER" "$DEVSTACK"/localrc
fi
# start devstack
echo "Start Devstack"
su "$OS_USER" -c "cd $DEVSTACK && ./stack.sh"