-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·44 lines (35 loc) · 1.46 KB
/
bootstrap.sh
File metadata and controls
executable file
·44 lines (35 loc) · 1.46 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
44
#!/usr/bin/env bash
# This script run under sudo by default so no need to
# put sudo statements here.
export DEBIAN_FRONTEND=noninteractive
apt-get update
# Avoid annoying Grub prompt
# See https://askubuntu.com/questions/146921/how-do-i-apt-get-y-dist-upgrade-without-a-grub-config-prompt
apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" upgrade
apt-get -y install libpq-dev libxml2-dev libxslt-dev
apt-get -y install libffi-dev libssl-dev
apt-get -y install libjpeg-dev
apt-get -y install gettext
apt-get -y install memcached
apt-get -y install python3
apt-get -y install libmysqlclient-dev
apt-get -y install mysql-server mysql-client
apt-get -y install python3-mysqldb
apt-get -y install python3-virtualenv
apt-get -y install python3-pip
mysql -uroot -e "CREATE USER 'met'@'localhost' IDENTIFIED BY 'met';"
mysql -uroot -e "CREATE DATABASE met;"
mysql -uroot -e "GRANT ALL ON *.* TO 'met'@'localhost';"
# update mysql conf file to allow remote access to the db
sudo sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf
service mysql restart
echo "export LC_ALL='en_US.UTF-8'" >> /home/vagrant/.profile
echo "export LC_CTYPE='en_US.UTF-8'" >> /home/vagrant/.profile
echo "cd /vagrant/" >> /home/vagrant/.profile
echo "source ~/venvs/met/bin/activate" >> /home/vagrant/.profile
su vagrant << EOF
virtualenv --python=python3 ~/venvs/met
source ~/venvs/met/bin/activate
cd /vagrant
pip install -r requirements.txt
EOF