A vagrant configuration to deploy a development virtual machine for D-PLACE, using Ubuntu 12.04, Ansible, Postgres, and PostGIS.
These applications must be installed on your host machine. They will be used to build and run a virtual machine containing D-PLACE.
Vagrant and VirtualBox installation packages can be downloaded from their respective websites. Ansible is a Python package with many ways to install. I use Homebrew and simply brew install ansible
.
These packages are available on many platforms, but I've only tested this on Mac OS X 10.9.
First, You will need to clone the repository and the submodule first:
git clone [email protected]:dleehr/dplace-vagrant.git
cd dplace-vagrant
git submodule init
git submodule update
With Virtualbox, vagrant, and ansible installed, deploying the virtual machine is done with
cd vagrant
vagrant up
This command takes a while - it's downloading a base virtual machine, installing software packages, loading D-PLACE from the git repo.
Sometimes provisioning fails with fatal: [192.168.111.222] => SSH encountered an unknown error during the connection.
. In this case simply retry with vagrant provision
The Vagrantfile configures shared folders and port forwarding, so that you can edit code and access the web application from your host machine (and not the vm). However, you must SSH to start the application or issue other Django management commands:
vagrant ssh
sudo su - dplace_user
source env_dplace/bin/activate
python /var/django/dplace/manage.py runserver 0.0.0.0:8000
Port 8000 on the virtual machine is forwarded to port 8010 locally, so visiting http://127.0.0.1:8010 should bring up the application.
Finally vagrant creates a dplace_src
directory on your host machine. This directory is synchronized with the D-PLACE code on the virtual machine, so you can use any text editor on your host machine to edit the code.