path: root/vagrant
diff options
authorHarald Eilertsen <haraldei@anduin.net>2014-01-11 16:20:21 +0100
committerHarald Eilertsen <haraldei@anduin.net>2014-01-11 16:20:21 +0100
commit3b29ca76240e26d31d5fdef50c699d185f3daa82 (patch)
tree8b0119ff331d68910b6502b4373553591329f430 /vagrant
parenta6302289c005e96520969a8abff3d5b262dfffb9 (diff)
Add vagrant setup to make deploying dev env easier.
Run 'vagrant up' to bootstrap the environment. The first time you do this, takes quite some time as it will download the base image, and provision it for the dev environment. Onse up you should be able to log in the the dev website by pointing your web browser to localhost:4567. The first time you will have to register a new user, and off you go. Run 'vagrant halt' to stop the vm. Next time you restart it using 'vagrant up' it should boot a lot faster, since the provisioning is already done. Run 'vagrant destroy' to clean up the VM and reclaim any disk space used by it. This will not remove the base image, only the instance in this dev environment. Notice: Due to a problem, the dev web server fails to start when doing a 'vagrant up' after the initial provisioning. To overcome this issue the following commands and you should be fine again: vagrant ssh sudo systemctl start rails logout Now wait a few seconds and the web server should respond again. I'll try to fix this problem later. requires vagrant and VirtualBox to work. See http://www.vagrantup.com for instructions on how to install vagrant for your system.
Diffstat (limited to 'vagrant')
2 files changed, 24 insertions, 0 deletions
diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh
new file mode 100644
index 0000000..14c42f3
--- /dev/null
+++ b/vagrant/bootstrap.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+pacman -Suyq --noconfirm
+pacman -Sq ruby gcc make sqlite3 nodejs --noconfirm
+echo "export GEM_HOME=`gem env gemdir`" > /etc/profile.d/rubygems.sh
+source /etc/profile.d/rubygems.sh
+gem install bundler --no-rdoc --no-ri --no-user-install
+cd /vagrant
+cp vagrant/rails.service /usr/lib/systemd/system
+systemctl enable rails
+systemctl start rails
diff --git a/vagrant/rails.service b/vagrant/rails.service
new file mode 100644
index 0000000..c37116e
--- /dev/null
+++ b/vagrant/rails.service
@@ -0,0 +1,12 @@
+Description="Systemd service to boot rails server when booting VM"
+ExecStart=/vagrant/script/rails server --port=80