Upload
marco-da-silva
View
1.718
Download
2
Embed Size (px)
DESCRIPTION
Development environments with Vagrant. Presentation at Codebits 2012
Citation preview
VagrantTeam development made easy
Me
Technical Leader @Centralway
Before? Intraneia
● Open-Source, UbuntuDeloitte
● IT Audits, Security & Privacy
How do we develop..
MySQL Apache2 Python PEAR RVM npm nginx PostgreSQL PHP Ruby
RoR MongoDB ....
???
Local development environment
Local development environment
No IsolationNot ShareableNot Repeatable
Alternative?Virtual Machines
Vagrant
Free and open source
Started on January 21, 2010 by Mitchell Hashimoto and John Bender.
The first release, 0.1.0 released on March 7, 2010.
Linux, Mac OS X, and Windows
Vision
The vision of the project is to create a tool to transparently manage all the complex parts of
modern development within a virtual environment without affecting the everyday
workflow of the developer too much.
Vagrant
~12000 lines of Ruby~3500 : test code~5500 : "plugins" ~3300 : core
Thats a lot of code!!!
Script must...
Import a virtual machinesetup host only networkingsetup shared foldersboots the machineprovision the machinesupport Mac, Linux, and Windowsguest additionsNFS
and how do we use it?
the basic way#Fetch the Box$ vagrant box add base http://files.vagrantup.com/precise32.box
#Init Vagrant on your current folder$ vagrant init
#Start it!!$ vagrant up
with various projects...
VagrantfileVagrant::Config.run do |config| config.vm.box = "debian" config.vm.box_url = "http://path/to/vagrantbox.box" config.vm.network :hostonly, "10.10.10.10", :adapter=>4 config.vm.customize ["modifyvm", :id, "--memory", "512"]end
VagrantfileVagrant::Config.run do |config| config.vm.box = "debian" config.vm.box_url = "http://path/to/vagrantbox.box" config.vm.network :hostonly, "10.10.10.10", :adapter=>4 config.vm.customize ["modifyvm", :id, "--memory", "512"]
config.vm.provision :puppet do |puppet| puppet.manifests_path = "vagrant/puppet/manifests" puppet.manifest_file = "base.pp" end
config.vm.provision :shell, :inline => "/bin/bash /vagrant/myscript.sh"end
VagrantfileVagrant::Config.run do |config| config.vm.box = "debian" config.vm.box_url = "http://path/to/vagrantbox.box" config.vm.network :hostonly, "10.10.10.10", :adapter=>4 config.vm.customize ["modifyvm", :id, "--memory", "512"]
config.vm.provision :puppet do |puppet| puppet.manifests_path = "vagrant/puppet/manifests" puppet.manifest_file = "base.pp" end
config.vm.provision :shell, :inline => "/bin/bash /vagrant/myscript.sh"end
Demo time....
important vagrant commands
vagrant up
vagrant provision
vagrant suspend
vagrant halt
vagrant destroy
tips
shared folders vs NFS
golden box vs clean box
similar environments -> helps deployments
Multi-VM Environments http://vagrantup.com/v1/docs/multivm.html
tips
veewee ● github.com/jedi4ever/veewee
puppet / chef
Thank You
vagrantup.comvagrantbox.esgithub.com/igama/wp-vagrant-demo