Vagrant for
Development
— linux_china
Agenda
What is Vagrant?
Why Vagrant
Env Management
Vagrant for Java
Vagrant for CI
What is Vagrant?
Create and configure lightweight,
reproducible, and portable
development environments
Virtual Machine, not Linux Container
VirtualBox based
Developed by Ruby
Why Vagrant?
Isolation, Repeatable(reuse), Reliable
development environment unified
Per project per VM by Vagrantfile
Distribute VM between team members
Say goodbye to "works on my machine" bugs
DevOps friendly
Env Management
Shell
Puppet
Chef
Jenv
Install tools manually
Vagrant for Java
jenv install
Maven repository sync: 


config.vm.synced_folder "~/.m2", "/home/vagrant/.m2"

Tools: Tomcat, Maven etc
Exec Maven Plugin to operate vagrant
Vagrant for CI
Isolated VM for project
Mock less
Env maintain easy
Maven with Vagrant support
Vagrant Install
Install VirtualBox
Install Vagrant
Install boxes: vagrant box install box_name http:/
/url
Init Vagrant: vagrant init box_name
Start VM: vagrant up
VM Access: Vagrant ssh
Stop VM: vagrant halt
Destroy VM: vagrant destroy
Package VM: vagrant package —output xxx.box
Boxes
lucid: Ubuntu 10.4
Precise: Ubuntu 12.4
CentOS 6.4
Vagrant Practice
NetDriver to store box file
vagrant.json
network: private network
hostname: config.vm.hostname=“xxxx"
FAQ

Vagrant for Development