Skip to content

Commit

Permalink
Added Vagrant virtual environment configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dkastl committed Jun 18, 2013
1 parent 02fe6c4 commit 44b462e
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,7 +1,8 @@
bin/*
Sample/*
.vagrant
osm2pgrouting
*.o
*~
.project
.cproject
Sample/*
22 changes: 22 additions & 0 deletions Vagrantfile
@@ -0,0 +1,22 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

pgbox = ENV['BOX'] || "precise64"

Vagrant.configure("2") do |config|

# Vagrant box configuration
config.vm.box = pgbox
config.vm.box_url = "http://files.vagrantup.com/%s.box" % [pgbox]

# Bootstrap script
config.vm.provision :shell, :path => "tools/vagrant/bootstrap.sh"

# Forward SSH agent to host
config.ssh.forward_agent = true

# Create synced folder for GnuPG keys
config.vm.synced_folder "~/.gnupg", "/home/vagrant/.gnupg"
config.vm.synced_folder "../", "/home/vagrant/repos"

end
22 changes: 22 additions & 0 deletions tools/vagrant/bootstrap.sh
@@ -0,0 +1,22 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# Vagrant - Virtualized Development
# Copyright(c) pgRouting Contributors
#
# Virtual environment bootstrap script
# ------------------------------------------------------------------------------

set -e # Exit script immediately on first error.
#set -x # Print commands and their arguments as they are executed.

# Abort provisioning if pgRouting development environment already setup.
# ------------------------------------------------------------------------------
which vim >/dev/null &&
{ echo "osm2pgrouting development environment already setup."; exit 0; }

# Run provisioning
# ------------------------------------------------------------------------------
echo "Installing packages ... this may take some time."
apt-get update -qq
apt-get install -y -qq vim packaging-dev checkinstall libboost-graph-dev libpq-dev libexpat1-dev

15 changes: 15 additions & 0 deletions tools/vagrant/packaging.sh
@@ -0,0 +1,15 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# Vagrant - Virtualized Development
# Copyright(c) pgRouting Contributors
#
# Prepare packaging
# ------------------------------------------------------------------------------

echo "DEBEMAIL=mail@example.com" > ~/.bash_aliases
echo "DEBFULLNAME='First Last'" >> ~/.bash_aliases

git config --global user.name "First Last"
git config --global user.email "mail@example.com"
git config --global core.editor vim
git config --global color.ui true

0 comments on commit 44b462e

Please sign in to comment.