Using Virtual Machines (VM)
To Build Automated Dev Environments
Local WordPress Development
Anthony E. Alvarez
Also known as @AnthonyEalvarez
I build sites
http://AnthonyAlvarez.us
Case Study: RailsBridge NYC
Topics

Why Vagrant is so awesome

How to get up and running fast

WordPress-related Vagrant resources
Your Computer is a Beautiful Lawn
A Server is like a beach
XAMPP/MAMP is a small sandbox
Installation
Vagrant Approach
Developer Benefits

Installing WordPress development environment in a reliable,
consistent and isolated way

Run a vagrant box configured exactly like production machine

Your machine is not tied to one project

Can customize each VM environment to match production.

Can have multiple VMs on a PC.

Debugging an edge issue due specific version of PHP, MySQL
etc.

Separates code and environment it runs in.

A more elegant solution compared to LAMP
The Vagrant Advantage

Repeatable

Verfiably correct

Isolated

Easy to understand

Focus on Dev not Ops

Cross Platform

Major Hypervisor support

Mature, stable, proven since 2010
Developer Workflow
1) Check out any project
2) ‘vagrant up’
3) Done
Bottom Line
Continue to work in your own browsers, editors,
and other tools.
The existence of Vagrant is
transparent and unimportant.
Vagrant is just the workhorse that creates
consistent and stable development environments.
Systems Operators
1) “vagrant up”
2) Complete sandbox to test ops scripts
Automation developed used for both production
and development.
With every vagrant up, developers get a fully
provisioned environment using the same scripts
as production.
Clean up
Vagrant destroy
Vagrant suspend
Vagrant halt.
Tao of Vagrant

Vagrant up will get you up and running at any moment.

Knowledge transfers to every project that uses Vagrant.

Vagrant is a general purpose Tool. Use it in a way that works best
for you.

May need to SSH into the machine to run some code.

No problem: vagrant ssh
Why Vagrant

Powerful work-flow

Clean abstractions

Uncompromising Flexibility
Get Up and Running Quickly
1. // Install Git and vagrant
2. // Install vagrant plugins
3. #vagrant plugin install vagrant-hostsupdater
4. // edits localhosts file and clean it when done
5. #vagrant plugin install vagrant-triggers
6. #git clone https://github.com/Varying-Vagrant-Vagrants/VVV dev
7. #git clone https://github.com/bradp/vv.git
8. //Variable VVV - the best VVV site wizard
9. #git clone https://github.com/leogopal/VVV-Dashboard
10. #mv VVV-Dashboard/dashboard* www/default/
11. #cd dev
12. #vagrant up
Varying-Vagrant-Vagrants (VVV)
Variable VVV
VagrantPress
●
Alternative to VVV for Testing plugins and themes
before deploying them on a live site
●
Creating a dev site for theme development
●
Running WordPress Betas to try new features
https://github.com/chad-thompson/vagrantpress
https://varyingvagrantvagrants.org/
WordPress Vagrant Resources

Ideas On Purpose

Mercury Vagrant

Chassis.io

Vagrant + Chef + WordPress

Salty WordPress

Evolution WordPress

VagrantPress

Atlas Directory of Vagrant Boxes
Ideas On Purpose
https://github.com/ideasonpurpose/basic-
wordpress-vagrant
Mercury Vagrant (HGV)
https://github.com/wpengine/hgv
Chassis.io
Use Chassis if you want an environment that’s simple yet powerful. It’s a minimalist
development setup that boots up fast and gets out of the way.
Use VVV if you want an environment that comes with lots of features, is highly extensible,
and can run many different site configurations.
Chassis is an open source virtual server for your WordPress site, built using Vagrant
Vagrant + Chef + WordPress
vccw.cc
Salty WordPress
Uses three great technologies: Salt, Vagrant, and
WordPress.
https://github.com/humanmade/Salty-WordPress
Evolution WordPress
Generate an entirely versioned, multi-environment
Wordpress site in under a minute!
https://github.com/evolution/wordpress
VagrantPress
VagrantPress is a packaged development
environment for developing WordPress themes
and modules.
https://github.com/chad-thompson/vagrantpress
Atlas Directory of Boxes
https://app.vagrantup.com/boxes/search
Thankyou
http://AnthonyAlvarez.us

DevOps Camp 2017 NYC Local Development using Vagrant by Anthony Alvarez