Skud/Vagrant

Installation requirements
Install these first:


 * Virtualbox (https://www.virtualbox.org/wiki/Downloads) -- approx 100MB
 * Vagrant (http://downloads.vagrantup.com/) -- approx 100MB

Fetch Growstuff code and set up your development environment
git clone https://github.com/Skud/growstuff.git vagrant cd vagrant git checkout -b vagrant origin/vagrant vagrant up

This will download a virtual box, ~1GB, then install stuff on it. (The second and subsequent times, you won't need to download it, but each subsequent "vagrant up" in a different directory will take ~1GB of your disk space.)

To get into your vagrant box, do:

vagrant ssh

You are now in the vagrant box, a virtual machine running on your own machine, which has all the necessary pre-requisites for working on Growstuff (eg. Postgres database, etc.)

cd code

You'll be asked to approve the .rvmrc. Say yes ("Y"). Then...

bundle install rake db:setup

Finally, run the tests and check that everything works:

rake

Working on Growstuff in vagrant
From now on, as you work on Growstuff, you should do the following things in the vagrant box:


 * bundle install
 * running tests, i.e. rake/rspec
 * running the local webserver (rails s or unicorn)
 * rails c
 * all other "rails" commands, eg. rails generate
 * all other "rake" commands or anything that calls them, eg. script/deploy-tasks.sh

You should do the following outside of vagrant, on your own local machine:


 * editing files (you can use whatever editor you want -- files are synced with your vagrant box automatically)
 * git actions, eg. git branch, git commit, git push

(If you really want to do those things inside your vagrant box, you can; you'll want to install your preferred text editor, set up git, etc inside vagrant, though.)

When you're done working on your vagrant box:

exit vagrant suspend

When you come back to work on Growstuff again

vagrant up

In case of major vagrant changes
If you ever want to totally blow away the vagrant stuff and restart it (for instance after a major change with new system dependencies):

vagrant destroy vagrant up

This will not affect your Growstuff code :)