Slide 1

Slide 1 text

__ ___ ___ __ ____ \ \ / \ \ / \ \ / / |___ \ \ \ / / \ \ / / \ \ / / __) | \ V / \ V / \ V / / __/ \_/ \_/ \_/ |_____| Varying Vagrant Vagrants Tom J Nowell @tarendai https://tomjn.com

Slide 2

Slide 2 text

This Talk Covers ● What is VVV ● What Changed in VVV 2 ● Migrating from VVV 1 ● Setting up a new Site ● Setting up an existing site

Slide 3

Slide 3 text

What is VVV?

Slide 4

Slide 4 text

A Local Developer Environment ● WP CLI ● PHP ● MariaDB ● MemcacheD ● Nginx ● Site Provisioning ● A standardised system

Slide 5

Slide 5 text

Installation From scratch ● Install Vagrant & Virtualbox & git ● Grab a copy of VVV from GitHub ● Run: vagrant plugin install vagrant-triggers vagrant-hostsupdater Then: vagrant up --provision

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

vagrant up Turns it on vagrant halt Turns it off

Slide 8

Slide 8 text

What Changed in VVV 2?

Slide 9

Slide 9 text

vvv-config.yml

Slide 10

Slide 10 text

Sites: # The wordpress-default configuration provides a default installation of the # latest version of WordPress. wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git hosts: - local.wordpress.dev # The wordpress-develop configuration is useful for contributing to WordPress. wordpress-develop: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-develop.git hosts: - src.wordpress-develop.dev - build.wordpress-develop.dev #example-site: # repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git # hosts: # - my-example-site.dev utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind

Slide 11

Slide 11 text

Important: Copy to vvv-custom.yml

Slide 12

Slide 12 text

Migrating from VVV 1

Slide 13

Slide 13 text

Backup your database Already done if you have vagrant-triggers

Slide 14

Slide 14 text

Rebuild: vagrant destroy Vagrant up --provision

Slide 15

Slide 15 text

Migrating a VVV 1 Site

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

sites: vvv1site: hosts: - vvv1site.dev

Slide 18

Slide 18 text

Always reprovision on changes vagrant reload --provision

Slide 19

Slide 19 text

Setting Up a New Site

Slide 20

Slide 20 text

Add a site to vvv-custom.yml: newsite: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-t emplate.git hosts: - newsite.com

Slide 21

Slide 21 text

sites: wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git hosts: - local.wordpress.dev wordpress-develop: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-develop.git hosts: - src.wordpress-develop.dev - build.wordpress-develop.dev newsite: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git hosts: - newsite.com utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind

Slide 22

Slide 22 text

Always reprovision on changes vagrant reload --provision

Slide 23

Slide 23 text

Setting Up An Existing Site

Slide 24

Slide 24 text

Add a site to vvv-custom.yml: site-name: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-t emplate.git hosts: - example.com

Slide 25

Slide 25 text

1. Reprovision 2. Copy files 3. Copy Database

Slide 26

Slide 26 text

Always reprovision on changes vagrant reload --provision

Slide 27

Slide 27 text

Advanced Provisioning

Slide 28

Slide 28 text

provision/vvv-init.sh A bash script that sets up your site provision/vvv-nginx.conf The NGINX config for your site

Slide 29

Slide 29 text

More Per Site Options skip_provisioning: true branch: develop

Slide 30

Slide 30 text

Custom Folders local_dir: vm_dir:

Slide 31

Slide 31 text

example-site: local_dir: /home/user/Documents/example vm_dir: /srv/www/examplesite hosts: - my-example-site.dev

Slide 32

Slide 32 text

sites: # The wordpress-default configuration provides a default installation of the # latest version of WordPress. wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git hosts: - local.wordpress.dev example-site: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git local_dir: /home/user/Documents/example vm_dir: /srv/www/examplesite hosts: - my-example-site.dev utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind

Slide 33

Slide 33 text

Custom PHP Versions nginx_upstream: php56

Slide 34

Slide 34 text

sites: # The wordpress-default configuration provides a default installation of the # latest version of WordPress. wordpress-default: repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git nginx_upstream: php70 hosts: - local.wordpress.dev example-site: repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git nginx_upstream: php56 hosts: - my-example-site.dev utilities: core: - memcached-admin - opcache-status - phpmyadmin - webgrind - php56

Slide 35

Slide 35 text

Common Troubleshooting Local Network Clashes VVV using the same IP as other computers Typos in vvv-custom.yml Syntax errors will break provisioning Corrupt VMs Powering down a machine unsafely, or disk corruption Out of Date Software Old Vagrant and Virtualbox Downgrading to VVV 1 Downgrading isn’t supported

Slide 36

Slide 36 text

Database Backups Vagrant triggers runs a backup script on halt/destroy that places SQL files in database/backups/*.sql Backups are restored on provision if the db is empty

Slide 37

Slide 37 text

More Info https://github.com/Varying-Vagrant-Vagrants https://varyingvagrantvagrants.org

Slide 38

Slide 38 text

Tom J Nowell VIP Wrangler at Automattic https://tomjn.com @tarendai

Slide 39

Slide 39 text

Q? Tom J Nowell @tarendai https://tomjn.com