# -*- mode: ruby -*- # vi: set ft=ruby : # This is a set of different vagrant setups that are primarily useful for package # building and testing. The techniques here were borrowed from the Git Fusion # team. Vagrant.configure(2) do |config| # Our development environment starts up all services within the VM, with # each service referencing the locally mounted source. # # You can edit and restart services to see updates, or, start them locally # and change your network references around. config.vm.define 'dev-ubuntu12' do |docker| docker.vm.box = 'precise64' docker.vm.box_url = 'http://files.vagrantup.com/precise64.box' docker.vm.network :private_network, ip: '172.16.100.20' # Note that shared folders will not work with Virtual Box Guest Additions 4.3.10 until this workaround is performed inside the guest: # https://www.virtualbox.org/ticket/12879#comment:2 # sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions docker.vm.synced_folder '.', '/home/vagrant/p4ws', mount_options: ['dmode=775,fmode=664'] docker.vm.provision 'salt' do |salt| salt.minion_config = './salt/minion-dev' salt.run_highstate = true end end # Creates a salt master that we can use to test out different test and build # scenarios locally before we set up the "CD" system. config.vm.define 'master' do |vagrant| vagrant.vm.box = 'precise64' vagrant.vm.box_url = 'http://files.vagrantup.com/precise64.box' vagrant.vm.network :private_network, ip: '172.16.100.5' vagrant.vm.synced_folder '.', '/home/vagrant/p4ws' vagrant.vm.provision 'salt' do |salt| salt.run_highstate = false salt.no_minion = true # salt.master_config = './salt/master' end end # Rebuilds the entire build environment as needed. config.vm.define 'build-ubuntu12' do |vagrant| vagrant.vm.box = 'precise64' vagrant.vm.box_url = 'http://files.vagrantup.com/precise64.box' vagrant.vm.network :private_network, ip: '172.16.100.10' # We need a bit more gas to build all of the required native extensions vagrant.vm.provider 'virtualbox' do |vb| vb.memory = 8056 vb.cpus = 2 end vagrant.vm.synced_folder '.', '/home/vagrant/p4ws' vagrant.vm.provision 'salt' do |salt| salt.minion_config = './salt/minion/build/minion' salt.run_highstate = true end # This is effectively the build process vagrant.vm.provision 'shell', inline:<<-END.gsub(/^[ ]{6}/, '') cd /home/vagrant/p4ws rake build END end # Spins up a machine that bases the software to be installed on the packages # created by the 'build-ubuntu12' environment. These packages are directly # referenced. config.vm.define 'test-ubuntu12' do |docker| docker.vm.box = 'precise64' docker.vm.box_url = 'http://files.vagrantup.com/precise64.box' docker.vm.network :private_network, ip: '172.16.100.11' docker.vm.synced_folder '.', '/home/vagrant/p4ws' docker.vm.provision 'salt' do |salt| salt.minion_config = './salt/minion/test/minion' salt.run_highstate = true end # This is effectively the test process docker.vm.provision 'shell', inline:<<-END.gsub(/^[ ]{6}/, '') cd /home/vagrant/p4ws echo rake test END end # TODO unlike these other environments, this should mimic a 'real user' # config.vm.define 'prod-ubuntu12' do |docker| end end