Add support for MySQL installation to the install.sh script
Change-Id: I1c45a59451d1966ef70368d679200ff9d71457e8
This commit is contained in:
parent
a2b5a10e84
commit
0221051396
|
@ -17,14 +17,17 @@ if [[ -e /etc/os-release ]]; then
|
||||||
# NOTE(berendt): support for centos/rhel/fedora/opensuse/sles will be added in the future
|
# NOTE(berendt): support for centos/rhel/fedora/opensuse/sles will be added in the future
|
||||||
|
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
RUN_DEMO=0
|
|
||||||
INSTALL_MESSAGING=0
|
INSTALL_DATABASE=0
|
||||||
INSTALL_FAAFO=0
|
INSTALL_FAAFO=0
|
||||||
RUN_WORKER=0
|
INSTALL_MESSAGING=0
|
||||||
RUN_API=0
|
RUN_API=0
|
||||||
|
RUN_DEMO=0
|
||||||
|
RUN_WORKER=0
|
||||||
URL_DATABASE='sqlite:////tmp/sqlite.db'
|
URL_DATABASE='sqlite:////tmp/sqlite.db'
|
||||||
URL_MESSAGING='rabbit://guest:guest@localhost:5672/'
|
|
||||||
URL_ENDPOINT='http://127.0.0.1'
|
URL_ENDPOINT='http://127.0.0.1'
|
||||||
|
URL_MESSAGING='rabbit://guest:guest@localhost:5672/'
|
||||||
|
|
||||||
while getopts e:m:d:i:r: FLAG; do
|
while getopts e:m:d:i:r: FLAG; do
|
||||||
case $FLAG in
|
case $FLAG in
|
||||||
i)
|
i)
|
||||||
|
@ -32,6 +35,9 @@ if [[ -e /etc/os-release ]]; then
|
||||||
messaging)
|
messaging)
|
||||||
INSTALL_MESSAGING=1
|
INSTALL_MESSAGING=1
|
||||||
;;
|
;;
|
||||||
|
database)
|
||||||
|
INSTALL_DATABASE=1
|
||||||
|
;;
|
||||||
faafo)
|
faafo)
|
||||||
INSTALL_FAAFO=1
|
INSTALL_FAAFO=1
|
||||||
;;
|
;;
|
||||||
|
@ -69,6 +75,19 @@ if [[ -e /etc/os-release ]]; then
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $INSTALL_DATABASE -eq 1 ]]; then
|
||||||
|
if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
|
||||||
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
|
||||||
|
sudo mysqladmin password password
|
||||||
|
sudo mysql -uroot -ppassword mysql -e "CREATE DATABASE IF NOT EXISTS faafo; GRANT ALL PRIVILEGES ON faafo.* TO 'faafo'@'%' IDENTIFIED BY 'password';"
|
||||||
|
sudo sed -i -e "/bind-address/d" /etc/mysql/my.cnf
|
||||||
|
sudo /etc/init.d/mysql restart
|
||||||
|
else
|
||||||
|
echo "error: distribution $ID not supported"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $INSTALL_MESSAGING -eq 1 ]]; then
|
if [[ $INSTALL_MESSAGING -eq 1 ]]; then
|
||||||
if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
|
if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then
|
||||||
sudo apt-get install -y rabbitmq-server
|
sudo apt-get install -y rabbitmq-server
|
||||||
|
|
Loading…
Reference in New Issue