zun/contrib/vagrant/install_devstack.sh
Feng Shengqin 677ba36549 Change to git.openstack.org
Change-Id: Ia8a68c5ba22cdb80ae0b5bd868ff499ac25f3207
Closes-Bug: #1692586
2017-05-24 01:55:50 +00:00

38 lines
883 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://git.openstack.org/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"