5b3293c146
* Update Vagrantfile to run git clone command as unprivileged to avoid having root own the directory * Update README to reflect changed command Change-Id: Ibfde4f9cce2367ee44afb43dbafbaf6d626d7381
24 lines
921 B
Bash
24 lines
921 B
Bash
#!/usr/bin/env bash
|
|
|
|
debconf-set-selections <<< 'mysql-server mysql-server/root_password password ROOTPASSWORD'
|
|
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password ROOTPASSWORD'
|
|
|
|
sudo apt-get update
|
|
sudo apt-get install -y python-dev ipython mysql-server mysql-client libmysqlclient-dev git vim rabbitmq-server python-pip librabbitmq1
|
|
|
|
pip install virtualenv
|
|
|
|
if [ ! -f /var/log/dbinstalled ];
|
|
then
|
|
echo "CREATE USER 'winchester'@'localhost' IDENTIFIED BY 'testpasswd'" | mysql -uroot -pROOTPASSWORD
|
|
echo "CREATE DATABASE winchester" | mysql -uroot -pROOTPASSWORD
|
|
echo "GRANT ALL ON winchester.* TO 'winchester'@'localhost'" | mysql -uroot -pROOTPASSWORD
|
|
echo "flush privileges" | mysql -uroot -pROOTPASSWORD
|
|
touch /var/log/dbinstalled
|
|
if [ -f /vagrant/data/initial.sql ];
|
|
then
|
|
mysql -uroot -pROOTPASSWORD internal < /vagrant/data/initial.sql
|
|
fi
|
|
fi
|
|
|