-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagrant.sh
81 lines (62 loc) · 2.07 KB
/
vagrant.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
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
#
# HabitRPG provisioning script
# function for autostart
function autostart_habitrpg {
update_config=$'Please update config.json with your values\nfor ADMIN_EMAIL, SMTP_USER, SMTP_PASS and SMTP_SERVICE,\nthen run "vagrant reload --provision"'
# check if config.json exists, then check if the defaults are still in place
if [ -e config.json ];
then
if grep -Fq 'ADMIN_EMAIL": "[email protected]' config.json;
then
echo "$update_config";
exit;
else
npm start
fi
else
cp config.json.example config.json;
echo "$update_config";
exit;
fi
}
# Main provisioning
echo Setting up HabitRPG...
echo cd /vagrant >> /home/vagrant/.bashrc
# Prevent warnings: "dpkg-preconfigure: unable to re-open stdin ..."
export DEBIAN_FRONTEND=noninteractive
echo Updating repositories...
apt-get update -qq
echo Installing Unix build tools - needed for node-gyp to use make...
apt-get install -qq build-essential
echo Installing GraphicsMagick - provides gm and convert...
apt-get install -qq graphicsmagick
echo Installing phantomjs and dependency...
apt-get install -qq phantomjs libicu48
echo Installing requirements for grunt-spritesmith...
apt-get install -qq pkg-config libcairo2-dev libjpeg-dev
echo Installing Mongodb...
apt-get install -qq mongodb
echo Installing Git...
apt-get install -qq git
echo Installing npm...
apt-get install -qq python-software-properties
echo Adding repository node.js...
apt-add-repository -y ppa:chris-lea/node.js
echo Updating repositories...
apt-get update -qq
echo Installing node.js
apt-get install -qq nodejs
cd /vagrant
echo Installing grunt/bower...
npm install -g grunt-cli bower
echo Installing HabitRPG
npm install
echo Installing Bower packages
sudo -H -u vagrant bower --config.interactive=false install -f
## # echo Seeding Mongodb...
## node ./src/seed.js
## no longer required - see comments in src/seed.js
# Uncomment both lines to autostart the habitrpg server when provisioning
# echo Starting HabitRPG server...
# autostart_habitrpg