Local development with vvv jon trujillo

Post on 11-Feb-2017

813 views 0 download

transcript

Local DevelopmentWith Vagrant & VVV

2015 WordCampSacramento

HOW I GOT HERE a brief overview of my Local Dev History

MY FIRST DEV ENVIRONMENT

Installed PHP, MySQL & Apache on OSX

MY NEXT DEV ENVIRONMENT

MAMP & MAMP PRO

AND THEN…

KINDA COWBOY CODING

AND THEN…

WHAT WE’LLBE GOING OVER

What is Vagrant

What is Varying Vagrant Vagrants(VVV)

Getting Set Up

Tools for working with VVV

Setting up a new site

Some other interesting Vagrant Projects

WHAT IS VAGRANT

WHAT IS VAGRANT

Software to setup sandboxed development environments

It uses Virtual Machines

Won’t junk up your native OS

Can be setup to better match to your production environment (nginx or apache)

SETTING UP VAGRANT

STEP 1

Install A Virtual Machine Provider

vmware Fusion or Workstation

STEP 1

STEP 2

Install VagrantThere are installers for

• Mac

• Windows

• Linux (Dabian & Centos)

STEP 2

STEP 3

Test it in your TerminalSTEP 3

VAGRANT COMMANDS

SOME HELPFUL COMMANDS

vagrant up

vagrant halt

vagrant ssh

vagrant suspend

vagrant resume

VARYING VAGRANT

VAGRANTS

WHATIS VVV

A vagrant environment that’s configured for WordPress development

Started life as a 10up project now it’s maintained by it’s own community

Includes a 💩 ton of stuff:

• Ubuntu • nginx (there is an apache branch too) • 4 Standard Wordpress Installs • WP-CLI • And more

INSTALL VVV

Install the vagrant plugin “vagrant-hostupdater"

STEP 1

Install the vagrant Plugin “vagrant-triggers"

STEP 2

Clone the VVV into a “vagrant-local” directory

STEP 3

Change directory into vagrant-local and “vagrant up”

STEP 4

Go make some coffee… this part takes a few minutes.

STEP 4

You’re running Variable Vagrant VagrantsTA-DA…

WHAT JUST HAPPENED?

Setup your Ubuntu development box

Created a site at vvv.dev with links to all the bundled tools & Links to default Installs

Setup the default WordPress installs

1. http://local.wordpress.dev/ 2. http://local.wordpress-trunk.dev/ 3. http://src.wordpress-develop.dev/ 4. http://build.wordpress-develop.dev/

Default Creds are admin & password

NOW WHAT?

Visit local.wordpress.dev in your browserGo Check

ACCESSING THE DATABASE

phpMyAdminvvv.dev/database-admin

SEQUEL PR0

VAGRANT SSH

Get silly with MySQL with the command line

SOME TOOLS

VVV DASHBOARDS

VVV.DEVTake the vvv.dev site from this…

BOOTSTRAP STYLED VVV.DEVto this…

VVV SITE WIZARDS

WHAT YOU GET WITH

VARIABLE VVV

WHAT YOU GET WITH VARIABLE VVV

Lets you type vv create in Terminal, answer a couple of questions and it builds your install.

1. Directory Name 2. Domain (Defaults to DirectoryName.dev) 3. Wordpress (Latest Stable or Trunk) 4. Multisite Install 5. Git Repo of wp-content folder 6. Local SQL file to import 7. Remove default themes & plugins 8. Add Sample Content 9. Enable WP_DEBUG & WP_DEBUG_LOG

WHAT YOU GET WITH VARIABLE VVVJust run vv create to start the ⚡wizard

REMOVE AN INSTALLWhen you realize you mistyped the install name…

A FEW OF THE VARIABLE VVV CREATION OPTIONS

Blueprints Set User Name, Password & Email Locale Create a Blank Site without WordPress

VAGRANT MANAGER

OTHER VAGRANT PROJECTS

MERCURY VAGRANT (HGV)WPEngine Vagrant Box that is

set up to match their environment

TRELLISFrom the Roots team. It’s an interesting

project that uses Ansible for provisioning

Any Questions?

THANK YOU!

I’m Jon Trujillo I work for Tytanium Ideas I’m a Husband, Dad & Jesus Freak Twitter: @jontrujillo LinkeIn: jontruijllo JonTrujillo.com