RSR_Dev RSR_Vagrant - adriancollier/demo GitHub Wiki
If you have never used Vagrant or the RSR Vagrant development environment, follow these steps first.
-
Ensure you have at least Vagrant version 1.2 installed:
~$ vagrant --version vagrant version 1.2.2If you don't have Vagrant installed or if you have an old version installed, head over to http://vagrantup.com to get it.
-
Ensure you have Oracle VirtualBox installed. If not, you can get it here: https://www.virtualbox.org/wiki/Downloads
The first time you use the RSR environment:
- Run
scripts/devhelpers/setup_etc_hosts.sh- this will add the necessary entries to your/etc/hostsfile to be able to access the RSR server - Pull down the repository containing the puppet manifests by running
git submodule initthengit submodule update. You will now have a copy of theakvo-provisioningrepository in a subfolder ofakvo-rsrcalled 'provisioning'. - Go into the vagrant directory and start the Vagrant box:
cd vagrantthenvagrant up. The first time will take a long time, as it will install all of the required system packages and configure them (eg, nginx) and then install all of the required python packages into an RSR virtualenv. - Try out http://rsr.localdev.akvo.org
- When you are done developing, run
vagrant haltto shut down the virtual machine, or it'll just sit there consuming system resources. - Run
vagrant sshto ssh into the virtual machine. You will then be logged in as thevagrantuser, who can use sudo without a password. - The RSR application information is in
/var/akvo/rsr/ - The
akvo-rsrrepository from your local machine is synced to the virtual machine, and the RSR application will restart when you make code changes.
There are a variety of useful scripts in scripts/devehelpers:
-
setup_etc_hosts.shwill add the necessary IP/address combinations to your/etc/hostsfile.cleanup_etc_hosts.shwill remove them again. -
manage.shwill connect to the virtual machine and runpython manage.py. You can use it just likepython manage.py, eg,manage.sh shell