diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | Vagrantfile (renamed from conf/Vagrantfile.example) | 14 | ||||
-rw-r--r-- | notes/vagrant.md | 66 |
3 files changed, 6 insertions, 75 deletions
diff --git a/.gitignore b/.gitignore index f60e3084c..577167f34 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *~ ._* +.vagrant .DS_Store .carton local-lib5 diff --git a/conf/Vagrantfile.example b/Vagrantfile index 3bcb288a9..7cebebbf9 100755 --- a/conf/Vagrantfile.example +++ b/Vagrantfile @@ -24,20 +24,16 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # accessing "localhost:8080" will access port 80 on the guest machine. config.vm.network :forwarded_port, guest: 3000, host: 3000 - config.vm.provider "virtualbox" do |v| - v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"] - end + config.vm.synced_folder ".", "/home/vagrant/fixmystreet", :owner => "vagrant", :group => "vagrant" config.vm.provision :shell, :inline => <<-EOS # To prevent "dpkg-preconfigure: unable to re-open stdin: No such file or directory" warnings export DEBIAN_FRONTEND=noninteractive - # To be in the shared directory where the repository might already be - cd /vagrant/ - # We need curl to fetch the install script - apt-get update -qq - apt-get install -qq -y curl >/dev/null - curl -s -O https://raw.githubusercontent.com/mysociety/commonlib/master/bin/install-site.sh + # Fetch and run install script + wget -O install-site.sh --no-verbose https://github.com/mysociety/commonlib/raw/master/bin/install-site.sh sh install-site.sh --dev fixmystreet vagrant 127.0.0.1.xip.io + # We want to be on port 3000 for development + sed -i -r -e "s,^( *BASE_URL: .*)',\\1:3000'," fixmystreet/conf/general.yml # All done echo "****************" echo "You can now ssh into your vagrant box: vagrant ssh" diff --git a/notes/vagrant.md b/notes/vagrant.md deleted file mode 100644 index 0ef9202f7..000000000 --- a/notes/vagrant.md +++ /dev/null @@ -1,66 +0,0 @@ -# Using Vagrant - -Vagrant provides an easy method to setup virtual development environments, for -further information see [their website](http://www.vagrantup.com). - -The included steps will use vagrant to create a dev environment where you can -run the test suite, the development server and of course make changes to the -codebase. - -The basic process is to create a "base" vm, and then "provision" it with the -software packages and setup needed. There are several ways to do this, including -Chef, Puppet, or the existing FixMyStreet install script which we will use. The -supplied scripts will create you a Vagrant VM based on the server edition of -Ubuntu 12.04 LTS that contains everything you need to work on FixMyStreet. - -## Pre-requisites - -1. Install [VirtualBox](http://www.virtualbox.org/wiki/Downloads) -2. Install [Vagrant](http://downloads.vagrantup.com/) - -## Get the FixMyStreet code - -Create a folder somewhere that you'll be doing your work from and clone the repo -into it. - -``` bash -mkdir FMS-vagrant -cd FMS-vagrant -git clone --recursive https://github.com/mysociety/fixmystreet.git -``` - -## Set up the Vagrant box - -The vagrant configuration needs to be placed in the correct place. - -``` bash -# NOTE - you need to be in the 'FMS-vagrant' dir - -cp fixmystreet/conf/Vagrantfile.example Vagrantfile - -# start the vagrant box. This will provision the system and can take a long time. -vagrant up --no-color -``` - -## Working with the vagrant box - -You should now have a local FixMyStreet development server to work with. You -can edit the files locally and the changes will be reflected on the virtual -machine. - -To start the dev server: - -``` bash -vagrant ssh - -# You are now in a terminal on the virtual machine -cd /vagrant/fixmystreet - -# run the dev server -bin/cron-wrapper script/fixmystreet_app_server.pl -d -r --fork -``` - -The server should now be running and you can visit it at the address -http://127.0.0.1.xip.io:3000/ - -Enjoy! |