-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.sh
28 lines (22 loc) · 1.09 KB
/
provision.sh
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
#!/bin/bash
echo "Provisioning virtual machine..."
apt-get update
echo "Installing MySQL..."
apt-get install debconf-utils -y > /dev/null
debconf-set-selections <<< "mysql-server mysql-server/root_password password v3gg13s"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password v3gg13s"
apt-get install mysql-server -y > /dev/null
echo "Creating Database..."
mysql --user="root" --password="v3gg13s" --execute="CREATE DATABASE localfood;"
echo "Adding MySQL user..."
mysql --user="root" --password="v3gg13s" --execute="CREATE USER 'localfooduser'@'localhost' IDENTIFIED BY 'v3gg13s';"
mysql --user="root" --password="v3gg13s" --execute="GRANT ALL PRIVILEGES ON localfood.* TO 'localfooduser'@'localhost';";
mysql --user="root" --password="v3gg13s" --execute="FLUSH PRIVILEGES;"
echo "Installing Node v6.11.0..."
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
source nodesource_setup.sh
apt-get install nodejs
echo "Adding .env file..."
echo "DB_NAME=localfood" >> /vagrant/.env
echo "DB_USER=localfooduser" >> /vagrant/.env
echo "DB_PASS=v3gg13s" >> /vagrant/.env