Clean up development vagrantfile a bit

This commit is contained in:
Fabio Rehm 2013-08-15 00:41:59 -03:00
parent 49b36c012a
commit 079f1fccbb

View file

@ -30,13 +30,27 @@ Vagrant.configure("2") do |config|
} }
end end
# Installs RVM
config.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.rvm ]; then
HOME=/home/vagrant su -p vagrant -l -c "curl -L https://get.rvm.io | bash -s stable"
fi
'
# Here we have the RVM cache bucket configured, so we install 2.0.0
config.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.rvm/rubies/ruby-1.9.3* ]; then
HOME=/home/vagrant su -p vagrant -l -c "rvm install 1.9.3 && rvm use 1.9.3 --default"
fi
'
debian_like_configs = lambda do |debian| debian_like_configs = lambda do |debian|
# Here we have the RubyGems cache bucket configured to the right path, so we
# bundle the project
debian.vm.provision :shell, inline: ' debian.vm.provision :shell, inline: '
if ! (which bundle > /dev/null); then sudo apt-get install git -y
sudo gem install bundler --no-ri --no-rdoc HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"
sudo apt-get install -y build-essential libffi-dev ruby1.9.1-dev git '
cd /vagrant && bundle
fi'
end end
config.vm.define :ubuntu do |ubuntu| config.vm.define :ubuntu do |ubuntu|
@ -53,26 +67,19 @@ Vagrant.configure("2") do |config|
config.vm.define :centos do |centos| config.vm.define :centos do |centos|
centos.vm.box = 'centos6_64' centos.vm.box = 'centos6_64'
centos.vm.box_url = 'http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.box' centos.vm.box_url = 'http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130309.box'
# Here we have the RubyGems cache bucket configured to the right path, so we
# bundle the project
centos.vm.provision :shell, inline: ' centos.vm.provision :shell, inline: '
if ! (which bundle > /dev/null); then yum install -y libffi-devel ruby-devel git
time sudo gem install bundler --no-ri --no-rdoc HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"'
time sudo yum install -y libffi-devel ruby-devel git
fi'
end end
config.vm.define :arch do |arch| config.vm.define :arch do |arch|
arch.vm.box = 'arch64' arch.vm.box = 'arch64'
arch.vm.box_url = 'http://vagrant.pouss.in/archlinux_2012-07-02.box' arch.vm.box_url = 'http://vagrant.pouss.in/archlinux_2012-07-02.box'
arch.vm.provision :shell, inline: ' arch.vm.provision :shell, inline: '
if ! (which bundle > /dev/null); then pacman -Syu --noconfirm libffi git
time sudo gem install bundler --no-ri --no-rdoc HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"'
time sudo pacman -Syu --noconfirm libffi git
fi'
end end
config.vm.provision :shell, inline: '
if ! [ -d /home/vagrant/.rvm ]; then
HOME=/home/vagrant su -p vagrant -c "curl -L https://get.rvm.io | bash -s stable"
fi
'
end end