11
Vagrant for Development — linux_china

Vagrant for Development

Embed Size (px)

DESCRIPTION

Vagrant for Development

Citation preview

Page 1: Vagrant for Development

Vagrant for Development

— linux_china

Page 2: Vagrant for Development

Agenda

What is Vagrant?

Why Vagrant

Env Management

Vagrant for Java

Vagrant for CI

Page 3: Vagrant for Development

What is Vagrant?

Create and configure lightweight, reproducible, and portable development environments

Virtual Machine, not Linux Container

VirtualBox based

Developed by Ruby

Page 4: Vagrant for Development

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

Page 5: Vagrant for Development

Env Management

Shell

Puppet

Chef

Jenv

Install tools manually

Page 6: Vagrant for Development

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

Page 7: Vagrant for Development

Vagrant for CI

Isolated VM for project

Mock less

Env maintain easy

Maven with Vagrant support

Page 8: Vagrant for Development

Vagrant InstallInstall 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

Page 9: Vagrant for Development

Boxes

lucid: Ubuntu 10.4

Precise: Ubuntu 12.4

CentOS 6.4

Page 10: Vagrant for Development

Vagrant Practice

NetDriver to store box file

vagrant.json

network: private network

hostname: config.vm.hostname=“xxxx"

Page 11: Vagrant for Development

FAQ