This repository was archived by the owner on Feb 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·69 lines (55 loc) · 1.85 KB
/
install.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
echo "Cd into project root"
cd $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
projectRoot=$( pwd )
if [ -d ../groupeat-api ]; then
echo "GroupEat API repository already exists"
else
echo "Cloning GroupEat API repository"
git clone [email protected]:GroupEat/groupeat-api.git ../groupeat-api
fi
if [ -d ../groupeat-web-app ]; then
echo "GroupEat Web App repository already exists"
else
echo "Cloning GroupEat Web App repository"
git clone [email protected]:GroupEat/groupeat-web-app.git ../groupeat-web-app
fi
if [ -d ../groupeat-showcase ]; then
echo "GroupEat Showcase repository already exists"
else
echo "Cloning GroupEat Showcase repository"
git clone [email protected]:GroupEat/groupeat-showcase.git ../groupeat-showcase
fi
echo "Cd into groupeat-api"
cd ../groupeat-api
while grep -qs FILL_ME example.env; do
echo 'Please fill the missing data in example.env'
read -n1 -r -p "Press any key to continue " key
echo ''
done
if [ ! -f .env ]; then
echo 'Copying example.env to .env'
cp example.env .env
fi
echo "Cd into project root"
cd $projectRoot
if grep -Fxqs "192.168.10.10 groupeat.dev" /etc/hosts; then
echo "/etc/hosts file already modified"
else
echo "Adding '192.168.10.10 groupeat.dev' to /etc/hosts"
echo "192.168.10.10 groupeat.dev" | sudo tee -a /etc/hosts
fi
if grep -Fxqs "192.168.10.10 app.groupeat.dev" /etc/hosts; then
echo "/etc/hosts file already modified"
else
echo "Adding '192.168.10.10 app.groupeat.dev' to /etc/hosts"
echo "192.168.10.10 app.groupeat.dev" | sudo tee -a /etc/hosts
fi
echo "Booting the VM"
vagrant up
echo "Building the Web App"
vagrant ssh -c "cd ~vagrant/app/current; npm install; npm run build"
echo "Building the Showcase"
vagrant ssh -c "cd ~vagrant/showcase/current; npm install; gulp build"
echo "SSH into the VM"
vagrant ssh