From 8b52d2b1123f9bb17c313a7a79e963cd0dbd6088 Mon Sep 17 00:00:00 2001 From: Craig Tracey Date: Tue, 17 Mar 2015 17:56:11 -0400 Subject: [PATCH] Update Vagrantfile to make use of OpenStack provider Updating the Vagrantfile so that builds may be run in an OpenStack cleanroom instance. More to come on this one. --- Vagrantfile | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index ed362aa..b2410f0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,29 +3,51 @@ GIFTWRAP_MANIFEST = ENV['GIFTWRAP_MANIFEST'] || 'examples/manifest.yml' GIFTWRAP_BUILDBOX_NAME = ENV['GIFTWRAP_BUILDBOX_NAME'] || 'ursula-precise' GIFTWRAP_BUILDBOX_URL = ENV['GIFTWRAP_BUILDBOX_URL'] || 'http://apt.openstack.blueboxgrid.com/vagrant/ursula-precise.box' +GIFTWRAP_POSTBUILD_SCRIPT = ENV['GIFTWRAP_POSTBUILD_SCRIPT'] || "" Vagrant.configure('2') do |config| config.vm.box = GIFTWRAP_BUILDBOX_NAME config.vm.box_url = GIFTWRAP_BUILDBOX_URL + config.ssh.username = 'ubuntu' + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.provider :openstack do |os| + os.openstack_auth_url = "#{ENV['OS_AUTH_URL']}/tokens" + os.username = ENV['OS_USERNAME'] + os.password = ENV['OS_PASSWORD'] + os.tenant_name = ENV['OS_TENANT_NAME'] + os.flavor = 'm1.small' + os.image = 'ubuntu-12.04' + os.openstack_network_url = ENV['OS_NEUTRON_URL'] + os.networks = ['internal'] + os.floating_ip_pool = 'external' + os.rsync_exclude_paths = [] + os.rsync_cvs_exclude = false + end + config.vm.provision 'shell', inline: <<-EOF if [ -f /etc/lsb-release ]; then - . /etc/lsb-release - OS=$DISTRIB_ID + . /etc/lsb-release + OS=$DISTRIB_ID elif [ -f /etc/debian_version ]; then - OS=Debian + OS=Debian elif [ -f /etc/redhat-release ]; then - OS=RedHat + OS=RedHat fi if [ "$OS" == "Debian" ] || [ "$OS" == "Ubuntu" ]; then - /vagrant/scripts/prepare_debian.sh + /vagrant/scripts/prepare_debian.sh fi gem install --no-ri --no-rdoc fpm cd /vagrant python setup.py install giftwrap build -m #{GIFTWRAP_MANIFEST} + + if [ ! -z "#{GIFTWRAP_POSTBUILD_SCRIPT}" ]; then + #{GIFTWRAP_POSTBUILD_SCRIPT} + fi + EOF config.vm.define 'giftwrap' do |c|