From 44b462e0dcf321daeab6f572d344509b44016e4e Mon Sep 17 00:00:00 2001 From: Daniel Kastl Date: Tue, 18 Jun 2013 21:09:33 +0900 Subject: [PATCH] Added Vagrant virtual environment configuration --- .gitignore | 3 ++- Vagrantfile | 22 ++++++++++++++++++++++ tools/vagrant/bootstrap.sh | 22 ++++++++++++++++++++++ tools/vagrant/packaging.sh | 15 +++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 Vagrantfile create mode 100755 tools/vagrant/bootstrap.sh create mode 100755 tools/vagrant/packaging.sh diff --git a/.gitignore b/.gitignore index 8e4bfd61..faced29b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ bin/* +Sample/* +.vagrant osm2pgrouting *.o *~ .project .cproject -Sample/* diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000..1f281aea --- /dev/null +++ b/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 diff --git a/tools/vagrant/bootstrap.sh b/tools/vagrant/bootstrap.sh new file mode 100755 index 00000000..55f965ca --- /dev/null +++ b/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 + diff --git a/tools/vagrant/packaging.sh b/tools/vagrant/packaging.sh new file mode 100755 index 00000000..cedff229 --- /dev/null +++ b/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