SlideShare a Scribd company logo
Powering Development
and Testing Environments
with Vagrant
Coen Jacobs / @CoenJacobs
at

WordCamp Norway 2014
!

#WCNorge
Coen Jacobs
@CoenJacobs
!

http://coenjacobs.me
!

WooThemes / WooCommerce
Powering Development
and Testing Environments
with Vagrant
Vagrant
Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with Vagrant
Problem at hand
Get someone started
on your project
Powering Development and Testing Environments with Vagrant
Let’s get you up and running…

•

“I just use MAMP, it’s brilliant”

•

“Tell me what you need and I’ll make a VM”

•

“My VPS runs a custom compiled LAMP setup”

•

“A server, what do I need that for?”
Bring order to chaos
Three common ways to do this
and all three are horrible…
1. Setup script
1. Setup script
•

Special maintenance!

•

Different to production!

•

Windows or Linux?
2. The über README
2. The über README
•

Extremely prone to user error!

•

Unlikely to keep it up to date!

•

Very time consuming!

•

Windows or Linux?
3. “Good luck, have fun”
3. “Good luck, have fun”
•

Extremely prone to user error!

•

Extremely time consuming!

•

Extremely frustrating!

•

Your developer will hate you…
Downsides
•

Not repeatable

•

Not verifiably correct

•

Not isolated

•

Difficult to understand

•

Slow
Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with Vagrant
What is Vagrant?
“A tool for creating,
managing and distributing
portable development
environments”
- Mitchell Hashimoto (creator of Vagrant)
What is Vagrant?
•

Command line tool

•

Creates virtual machines

•

Handles networking and shared folders

•

Supports provisioning
What problems does it solve?
•

Repeatable & verifiably correct

•

Isolated

•

Understandable

•

As fast as possible
What problems does it solve?

•

Works on Mac, Windows and Linux

•

Works with VirtualBox, VMware and many more
How does it work then?
It’s magic, it really is…
“Vagrant reads a
Vagrantfile and builds a
virtual machine based on
a template called a box”
- Mitchell Hashimoto (creator of Vagrant)
Vagrantfile
“The primary function of the
Vagrantfile is to describe the type
of machine required for a project,
and how to configure and
provision these machines.”
http://docs.vagrantup.com/v2/vagrantfile/index.html
Vagrantfile
Vagrant::configure("2") do |config|!
! config.vm.box = "precise32"!
! config.vm.box_url = “http://.../precise32.box”!
! config.vm.hostname = "vagrant.localhost"!
!

! config.vm.network :private_network, ip: "192.168.99.100"!
end
Virtual machine
•

Isolated environment

•

Any operating system

•

Any installed software

•

Project specific configuration and versions
Boxes
“Boxes are the skeleton from
which Vagrant machines are
constructed. They are portable
files which can be used by others
on any platform that runs Vagrant
to bring up a working
environment.”
http://docs.vagrantup.com/v2/boxes.html
Boxes
•

Pre-installed OS

•

May contain pre-installed software

•

Custom boxes can be made
Provisioning
Provisioning
“Provisioners in Vagrant allow you
to automatically install software,
alter configurations, and more on
the machine as part of the vagrant
up process.”
http://docs.vagrantup.com/v2/provisioning/index.html
Provisioning
•

Shell

•

Ansible

•

Chef

•

Puppet

•

Docker

•

Salt
Providers
Enabling Vagrant to do its job
Providers
“While Vagrant ships out of the
box with support for VirtualBox,
Vagrant has the ability to manage
other types of machines as well.
This is done by using other
providers with Vagrant.”
https://docs.vagrantup.com/v2/providers/index.html
Providers
•

VirtualBox

•

VMware

•

AWS

•

Rackspace

•

Digital Ocean




and many more…
Change providers dynamically

vagrant up --provider=vmware_fusion
vagrant up --provider=digital_ocean
Does this really make a
developers life easier?
YES!
Old situation
•

Setup script

•

The über README file

•

“Good luck, have fun”




or any other manual way of configuring…
Powering Development and Testing Environments with Vagrant
Vagrant is more like…
Get started with a Vagrant project

git clone repository.git folder!
cd folder!
vagrant up
Powering Development and Testing Environments with Vagrant
What did Vagrant do
in the background?
The vagrant up command
•

Check if the box is already downloaded
•

If not, download the box

•

Start the VM

•

Set up synced folders

•

Set up networking

•

Start provisioning
Your new VM is ready
vagrant ssh
vagrant halt
vagrant destroy
Your new VM is ready
•

Some examples of what ‘ready’ means:
•

Nginx installed

•

PHP installed

•

MySQL installed

•

WordPress installed

•

Database imported

•

wp-config.php file set up
From development and
testing to production
Using Vagrant to its full potential
Vagrantfile in version control

•

Commit your Vagrantfile

•

Share it with all developers

•

Commit a change, all developers benefit
Share the provisioning
•

Provisioning files into version control as well

•

Production server shares the provisioning files
•

•

Use parameters/flags for differences

Change one, all environments will change
… and this is only
the beginning
Advanced use cases
Now we’re talking!
Plugin testing
•

Stable version

•

Development version

•

Combine those two on stable/dev WordPress

•

Four local websites per plugin
Multiple PHP version testing
•

One Vagrantfile

•

Multiple machines

•

Different PHP versions

•

One shared set of files

•

One database

http://wordpress.org/about/stats/
Integrate useful tools
•

WP-CLI

•

REDIS

•

Xdebug

•

Memcache

•

WebGrind

•

Your own dotfiles
All going a little too fast?
No worries
Vagrant has great documentation

•

http://docs.vagrantup.com/v2/

•

Plenty of examples

•

Great pointers to providers and provision resources

•

Vagrant is the latest trend
Varying Vagrant Vagrants
Varying Vagrant Vagrants
•

https://github.com/10up/varying-vagrant-vagrants

•

Ready to use Vagrant setup

•

Really easy to expand

•

Quickly launch new local development websites

•

Automatically installs: WP-CLI, Nginx, MySQL, PHPFPM, Memcache, Xdebug, Imagemagick, PHPunit,
Composer, NodeJS, Grunt, WebGrind and much,
much more, all on one Ubuntu 12.04 VM.
Let’s make the world a better place
for developers
!

Start using Vagrant
Questions?
Now, or come find me later!
!

@CoenJacobs
http://coenjacobs.me
Photo credits
1. http://www.flickr.com/photos/tinali778/2947963220/
2. http://www.flickr.com/photos/naan/2948047370/
3. http://www.flickr.com/photos/riebart/4466482623/
4. http://www.flickr.com/photos/55915190@N00/2302651444/
5. http://www.flickr.com/photos/l2f1/4895151918/
6. http://www.flickr.com/photos/basykes/490907537/
7. http://www.flickr.com/photos/whiskeytango/2098182380/
8. http://www.flickr.com/photos/chr1sp/5942681564/
9. http://www.flickr.com/photos/5wa/6109494115/
10.http://www.flickr.com/photos/msimdottv/4339697089/

More Related Content

What's hot (20)

PDF
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
PDF
Docker
Michael Lihs
 
PPTX
How To Set a Vagrant Development System
Paul Bearne
 
PDF
Vagrant + Ansible + Docker
Vijay Selvaraj
 
PDF
Building with Virtual Development Environments
Oscar Merida
 
PPTX
Automate your Development Environment with Vagrant & Chef
Michael Lihs
 
KEY
Using Vagrant
andygale
 
PDF
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
Anthony Alvarez
 
PDF
Codecoon - A technical Case Study
Michael Lihs
 
PDF
Vagrant and docker
文峰 眭
 
PDF
PHP Deployment With SVN
Lorna Mitchell
 
PDF
An Introduction to Vagrant and Docker
Scott Lowe
 
PDF
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
PDF
Docker zero
Manuel de la Peña Peña
 
PDF
Open source and cross platform .net
Ibon Landa
 
PPTX
Ansible E2E Testing
Roberto Perez-Rodriguez
 
PDF
Test-Driven Infrastructure with Chef
Michael Lihs
 
PPT
Docker Practical Use Cases
Alexei Yuzhakov
 
PPTX
Managing Large Selenium Grid
dimakovalenko
 
PDF
Delivery Pipeline for Windows Machines
Dmitry Buzdin
 
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
Docker
Michael Lihs
 
How To Set a Vagrant Development System
Paul Bearne
 
Vagrant + Ansible + Docker
Vijay Selvaraj
 
Building with Virtual Development Environments
Oscar Merida
 
Automate your Development Environment with Vagrant & Chef
Michael Lihs
 
Using Vagrant
andygale
 
DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez
Anthony Alvarez
 
Codecoon - A technical Case Study
Michael Lihs
 
Vagrant and docker
文峰 眭
 
PHP Deployment With SVN
Lorna Mitchell
 
An Introduction to Vagrant and Docker
Scott Lowe
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
Open source and cross platform .net
Ibon Landa
 
Ansible E2E Testing
Roberto Perez-Rodriguez
 
Test-Driven Infrastructure with Chef
Michael Lihs
 
Docker Practical Use Cases
Alexei Yuzhakov
 
Managing Large Selenium Grid
dimakovalenko
 
Delivery Pipeline for Windows Machines
Dmitry Buzdin
 

Similar to Powering Development and Testing Environments with Vagrant (20)

PPTX
Varying wordpressdevelopmentenvironment wp-campus2016
David Brattoli
 
PPTX
Varying WordPress Development Environment WordCamp Columbus 2016
David Brattoli
 
PDF
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
PDF
Building with Virtual Development Environments
Oscar Merida
 
PDF
Vagrant Binding JayDay 2013
Hendrik Ebbers
 
PPTX
Varying WordPress Development Environment WordCamp Cincinnati 2016
David Brattoli
 
PPTX
WordPress Development Environments
Josh Cummings
 
PDF
Vagrant for local and team WordPress Development
Anthony Alvarez
 
PDF
Instant ColdFusion with Vagrant
ColdFusionConference
 
PDF
Instant ColdFusion with Vagrant
ColdFusionConference
 
PPTX
Virtualization for Developers
John Coggeshall
 
PDF
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
PDF
Take Home Your Very Own Free Vagrant CFML Dev Environment
ColdFusionConference
 
PDF
Vagrant for Effective DevOps Culture
Vaidik Kapoor
 
PDF
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData
 
PDF
Using Vagrant, Puppet, Testing & Hadoop
Puppet
 
PDF
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck
 
PDF
Vagrant Plugin development
ru_Parallels
 
PDF
Containing the world with Docker
Giuseppe Piccolo
 
PPTX
Vagrant to-aws-flow
Kimberly Macias
 
Varying wordpressdevelopmentenvironment wp-campus2016
David Brattoli
 
Varying WordPress Development Environment WordCamp Columbus 2016
David Brattoli
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
John Rofrano
 
Building with Virtual Development Environments
Oscar Merida
 
Vagrant Binding JayDay 2013
Hendrik Ebbers
 
Varying WordPress Development Environment WordCamp Cincinnati 2016
David Brattoli
 
WordPress Development Environments
Josh Cummings
 
Vagrant for local and team WordPress Development
Anthony Alvarez
 
Instant ColdFusion with Vagrant
ColdFusionConference
 
Instant ColdFusion with Vagrant
ColdFusionConference
 
Virtualization for Developers
John Coggeshall
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Gavin Pickin
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
ColdFusionConference
 
Vagrant for Effective DevOps Culture
Vaidik Kapoor
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData
 
Using Vagrant, Puppet, Testing & Hadoop
Puppet
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck
 
Vagrant Plugin development
ru_Parallels
 
Containing the world with Docker
Giuseppe Piccolo
 
Vagrant to-aws-flow
Kimberly Macias
 
Ad

More from Coen Jacobs (8)

PPT
WooCommerce 2.0 and beyond
Coen Jacobs
 
KEY
State of WordPress & eCommerce in 2012
Coen Jacobs
 
KEY
WordPress Custom Post Types
Coen Jacobs
 
KEY
Versiebeheer
Coen Jacobs
 
KEY
WordPress core contributions
Coen Jacobs
 
KEY
WordPress Meetup Eindhoven 2011
Coen Jacobs
 
PDF
WordCamp NL 2010: Plugin ontwikkeling
Coen Jacobs
 
PPTX
Ontwikkeling Wordpress Plugins
Coen Jacobs
 
WooCommerce 2.0 and beyond
Coen Jacobs
 
State of WordPress & eCommerce in 2012
Coen Jacobs
 
WordPress Custom Post Types
Coen Jacobs
 
Versiebeheer
Coen Jacobs
 
WordPress core contributions
Coen Jacobs
 
WordPress Meetup Eindhoven 2011
Coen Jacobs
 
WordCamp NL 2010: Plugin ontwikkeling
Coen Jacobs
 
Ontwikkeling Wordpress Plugins
Coen Jacobs
 
Ad

Recently uploaded (20)

PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Python basic programing language for automation
DanialHabibi2
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Powering Development and Testing Environments with Vagrant