Extremely Powerful Local WordPress Development with Vagrant and Friends

Extremely Powerful Local WordPress Development with Vagrant and Friends

D529f2403e21f08bfa16365bdf032f81?s=128

Brad Parbs

July 25, 2015
Tweet

Transcript

  1. (and it has some real neat friends)

  2. I’m Brad Parbs • Developer @ WebDevStudios • Push code

    to http://github.com/bradp • http://brad.party
  3. Let’s talk about local development environments.

  4. Let’s talk about local development environments.

  5. Let’s talk about local development environments.

  6. So, what’s Vagrant? Create and configure lightweight, reproducible, and portable

    development environments.
  7. I ♥ Vagrant & friends. Vagrant VVV VV

  8. I ♥ Vagrant & friends. • Easy WPCLI • Setting

    up sites super fast • Always up-to-date • No more MAMP • Keeps your system clean
  9. wp cli

  10. What can you do with WPCLI? $ wp core update

    $ wp plugin install logout-roulette $ wp scaffold post-type books
  11. Setting up and managing sites super easily!

  12. Scripting site setup • Auto-create Sublime project • Add to

    SourceTree • Open in Chrome • Anything you can imagine
  13. Installing Vagrant

  14. None
  15. None
  16. Installing Vagrant • Any OS works! • Install VirtualBox (4.2.x

    or 4.3.6 recommended by VVV) • Install Vagrant http://www.vagrantup.com/downloads.html https://www.virtualbox.org/wiki/Downloads
  17. How does it actually work though? • VirtualBox runs a

    VM • Vagrant manages it
  18. How to use • Clone a box • Start up

    a virtual machine • Use it! • Pause / Destroy it anytime
  19. Commands $ vagrant init $ vagrant up $ vagrant halt

    $ vagrant destroy $ vagrant provision $ vagrant ssh
  20. None
  21. Varying Vagrant Vagrants “Varying Vagrant Vagrants is an evolving Vagrant

    configuration focused on WordPress development.”
  22. Installation $ vagrant plugin install vagrant-hostsupdater $ git clone git://github.com/Varying-Vagrant-Vagrants/VVV.git

    $ cd VVV $ vagrant up
  23. How VVV works • Uses Ubuntu+Nginx • Automatic provisioning script

    for WP updates • Keeps database on host filesystem • Easy to modify / configure
  24. Sites VVV creates for you

  25. http://local.wordpress.dev/ for WordPress stable

  26. http://local.wordpress-trunk.dev/ for WordPress trunk

  27. http://src.wordpress-develop.dev/ for trunk WordPress development files

  28. http://build.wordpress-develop.dev/ for the version of those development files built with

    Grunt
  29. http://vvv.dev/ Default dashboard containing several useful tools: PHPmyAdmin, OPCache, links

    to all sites, etc
  30. VV http://vvv.dev/ Default dashboard containing several useful tools: PHPmyAdmin, OPCache,

    links to all sites, etc https://github.com/leogopal/VVV-Dashboard
  31. Helpful aliases $ alias v=vagrant $ alias vp="vagrant provision" $

    alias vup="vagrant up --provision && vagrant ssh"
  32. Other things • Prefer Apache? https://github.com/ericmann/vvv-apache

  33. Scripting Site Setup https://github.com/varying-vagrant-vagrants/vvv/wiki/Auto-site-Setup

  34. VV https://github.com/bradp/vv

  35. Installation • $ brew install bradp/vv/vv

  36. How does it work? Gives you a super helpful “$

    vv” command
  37. How does it work? Gives you a super helpful “$

    vv” command
  38. Commands • $ vv create • $ vv delete •

    $ vv list
  39. Advanced Commands • $ vv --deployment-create • $ vv --blueprint-init

    • $ vv -v up
  40. Developer Workflow (live demo ?)

  41. Speeding up Vagrant Provision • VVV looks for custom-provision.sh in

    provision folder. • You can remove the WP updates and apt-get updates for more speed.
  42. None
  43. None
  44. More Tips and Tricks • Anything you do that’s repetitive,

    script it! • Learn to love ‘vagrant provision’
  45. None