forked from HabitRPG/habitica
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated base vagrant box. added full provisioning of HRPG env.
- Loading branch information
1 parent
c1a2193
commit 326b65a
Showing
3 changed files
with
100 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# The vagrant config for HabitRPG. Requires vagrant on your local machine. | ||
# The box fetched will be precise64 located: | ||
# http://files.vagrantup.com/precise64.box | ||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | ||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
config.vm.box = "thepeopleseason/habitrpg" | ||
config.ssh.forward_agent = true | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "habitrpg" | ||
config.vm.box_url = "http://dl.dropboxusercontent.com/u/4309797/devel/habitrpg/habitrpg.box" | ||
config.vm.hostname = "habitrpg" | ||
config.vm.network "forwarded_port", guest: 3000, host: 3000 | ||
#config.vm.provision :shell, :path => "vagrant.sh" | ||
config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true | ||
config.vm.usable_port_range = (3000..3050) | ||
config.vm.provision :shell, :path => "vagrant.sh" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,57 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# HabitRPG provisioning script | ||
|
||
update_config=$'Please update config.json with your values\nfor ADMIN_EMAIL, SMTP_USER, SMTP_PASS and SMTP_SERVICE,\nthen run "vagrant reload --provision"' | ||
# 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"' | ||
|
||
cd /vagrant | ||
# 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; | ||
# 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; | ||
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 | ||
|
||
apt-get update -qq | ||
|
||
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 | ||
apt-add-repository -y ppa:chris-lea/node.js | ||
apt-get update -qq | ||
apt-get install -qq nodejs | ||
|
||
cd /vagrant | ||
|
||
echo Installing grunt/bower... | ||
npm install -g grunt-cli bower | ||
|
||
echo Installing HabitRPG | ||
npm install | ||
|
||
echo Seeding Mongodb... | ||
node ./src/seed.js | ||
|
||
# Uncomment this line to autostart the habitrpg server when provisioning | ||
# autostart_habitrpg | ||
|