aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-03-07 16:00:44 +0000
committerGareth Rees <gareth@mysociety.org>2014-03-11 10:52:28 +0000
commitb81363df2dfa13b3178a57178bcf287155b4b88a (patch)
treec0ce13bfb7ad4a5fb9a6a0a240e5a57ab8c40e25
parent57005fd0ff6d05167e0cce2795a2c3352497c9ab (diff)
Create development environment with Vagrant
Share the host git checkout in to the VM so that a developer can use their preferred environment while running the application in a production-like environment. Use the --dev option of install-site.sh so that the existing git checkout is used. The gems are installed outside of the app directory in development because VirtualBox's directory shares can be slow when the directory contains an excessive amount of files. Installing gems in to this directory results in ~15K additional files, which is beyond what VirtualBox can reasonably be expected to handle
-rw-r--r--config/Vagrantfile6
1 files changed, 5 insertions, 1 deletions
diff --git a/config/Vagrantfile b/config/Vagrantfile
index 6932374e9..fe071864e 100644
--- a/config/Vagrantfile
+++ b/config/Vagrantfile
@@ -15,6 +15,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, :ip => "10.10.10.30"
+ config.vm.synced_folder "../.", "/home/vagrant/alaveteli", :owner => "vagrant", :group => "vagrant"
+
+ config.ssh.forward_agent = true
# The bundle install fails unless you have quite a large amount of
# memory; insist on 1.5GiB:
@@ -29,7 +32,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# master:
config.vm.provision :shell, :inline => "sed -i -e 's/BRANCH=master/BRANCH=install-script/' install-site.sh"
config.vm.provision :shell, :inline => "./install-site.sh " \
+ "--dev " \
"alaveteli " \
- "alaveteli " \
+ "vagrant " \
"#{ ALAVETELI_FQDN }"
end