85 lines
2.6 KiB
Ruby
85 lines
2.6 KiB
Ruby
# -*- mode: ruby -*-
|
|
# vi: set ft=ruby :
|
|
|
|
Vagrant.require_plugin 'vagrant-cachier'
|
|
Vagrant.require_plugin 'vagrant-librarian-chef'
|
|
Vagrant.require_plugin 'vagrant-lxc'
|
|
Vagrant.require_plugin 'vagrant-omnibus'
|
|
Vagrant.require_plugin 'vagrant-pristine'
|
|
|
|
Vagrant.configure("2") do |config|
|
|
config.vm.synced_folder "../", "/vagrant", id: 'vagrant-root'#, nfs: true
|
|
|
|
config.cache.scope = :machine
|
|
config.cache.auto_detect = true
|
|
config.cache.enable_nfs = true
|
|
|
|
config.vm.provider :virtualbox do |_, vb|
|
|
vb.vm.network :private_network, ip: "192.168.50.123"
|
|
end
|
|
|
|
config.omnibus.chef_version = :latest
|
|
config.vm.provision :chef_solo do |chef|
|
|
chef.add_recipe "java::oracle"
|
|
chef.json = {
|
|
:java => {
|
|
:oracle => {
|
|
:accept_oracle_download_terms => true
|
|
}
|
|
}
|
|
}
|
|
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|
|
|
# Here we have the RubyGems cache bucket configured to the right path, so we
|
|
# bundle the project
|
|
debian.vm.provision :shell, inline: '
|
|
sudo apt-get install git -y
|
|
HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"
|
|
'
|
|
end
|
|
|
|
config.vm.define :ubuntu do |ubuntu|
|
|
ubuntu.vm.box = "quantal64"
|
|
debian_like_configs.call ubuntu
|
|
end
|
|
|
|
config.vm.define :debian do |debian|
|
|
debian.vm.box = "squeeze64"
|
|
debian.vm.box_url = 'http://f.willianfernandes.com.br/vagrant-boxes/DebianSqueeze64.box'
|
|
debian_like_configs.call debian
|
|
end
|
|
|
|
config.vm.define :centos do |centos|
|
|
centos.vm.box = 'centos6_64'
|
|
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: '
|
|
yum install -y libffi-devel ruby-devel git
|
|
HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"'
|
|
end
|
|
|
|
config.vm.define :arch do |arch|
|
|
arch.vm.box = 'arch64'
|
|
arch.vm.box_url = 'http://vagrant.pouss.in/archlinux_2012-07-02.box'
|
|
arch.vm.provision :shell, inline: '
|
|
pacman -Syu --noconfirm libffi git
|
|
HOME=/home/vagrant su -p vagrant -l -c "cd /vagrant && bundle"'
|
|
end
|
|
|
|
end
|