-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathdevstack.sh
More file actions
executable file
·43 lines (32 loc) · 1.17 KB
/
devstack.sh
File metadata and controls
executable file
·43 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
# environment variables
OPENSTACK_BRANCH=stable/havana
OPENSTACK_ADM_PASSWORD=devstack
# determine own script path
BASHPATH="`dirname \"$0\"`" # relative
BASHPATH="`( cd \"$BASHPATH\" && pwd )`" # absolutized and normalized
echo "run script from $BASHPATH"
export OPENSTACK_BRANCH=$OPENSTACK_BRANCH
export OPENSTACK_ADM_PASSWORD=$OPENSTACK_ADM_PASSWORD
# update system
export DEBIAN_FRONTEND noninteractive
sudo apt-get update || sudo yum update -y
sudo apt-get install -qqy git || sudo yum install -y 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 $OPENSTACK_BRANCH 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"