wordpress development environments

51
WordPress Development Environments Josh Cummings joshcummingsdesign.com @jcummingsdesign

Upload: josh-cummings

Post on 23-Jan-2018

289 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: WordPress Development Environments

WordPress Development

Environments

Josh Cummingsjoshcummingsdesign.com

@jcummingsdesign

Page 2: WordPress Development Environments

Objectives

• What is a development environment?

• What tools exist for creating and configuring a

WordPress development environment?

• What tools exist to help us deploy our code?

Page 3: WordPress Development Environments

Humble Beginnings

Page 4: WordPress Development Environments

Workflow

Page 5: WordPress Development Environments
Page 6: WordPress Development Environments

What is a development

environment?

Page 7: WordPress Development Environments

A collection of procedures and tools

for writing, testing, debugging, and

deploying your code.

Page 8: WordPress Development Environments

What tools do we need

to run WordPress?

Page 9: WordPress Development Environments

LAMP Stack

• Linux

• Apache

• MySQL

• PHP

Page 10: WordPress Development Environments

LEMP Stack

• Linux

• Nginx

• MariaDB

• PHP

Page 11: WordPress Development Environments

The WordPress Stack

Page 12: WordPress Development Environments
Page 13: WordPress Development Environments

Local

Development

Staging

Production

Page 14: WordPress Development Environments

Command Line Tools

• Versioning (Git / SVN)

• WP-CLI

• Task Runners (Gulp / Grunt)

• Dependency Managers (Composer / npm / Bower)

Page 15: WordPress Development Environments

Text Editors / IDEs

• PhpStorm

• Sublime Text

• Atom

Page 16: WordPress Development Environments

Database Clients

• Sequel Pro

• Navicat

Page 17: WordPress Development Environments

What tools exist to help us set

up our local development

environment?

Page 18: WordPress Development Environments

–Terry Pratchett

“If you don't know where you are, then you don't

know where you're going, and if you don't know

where you're going, you're probably going wrong.”

Page 19: WordPress Development Environments

Things to Consider

• Will I be working on a team?

• Will I be developing a theme or plugin, or working on

WordPress core?

• How do I plan on deploying my code?

Page 20: WordPress Development Environments

The “works on mine” issue.

Page 21: WordPress Development Environments

The 3 Month Test

Page 22: WordPress Development Environments

Find the right

tools for the job.

Page 23: WordPress Development Environments

AMP

• XAMPP

• MAMP

• WAMP

Page 24: WordPress Development Environments

MAMP

Page 25: WordPress Development Environments

• Simple to setup

• Little to no configuration needed

MAMP - Pros

Page 26: WordPress Development Environments

• Brittle, tied to specific versions

• Less parity, more coupled

MAMP - Cons

Page 27: WordPress Development Environments

DesktopServer

Page 28: WordPress Development Environments

DesktopServer

• Cross-platform

• Easy to setup

• Blueprints will save you time

• Direct Deploy makes deploying easy

Page 29: WordPress Development Environments

Native Stack

Page 30: WordPress Development Environments

Linux / Mac

• Create an image for your team that has all of the

necessary configuration for your stack

• Leverage scripting for creating new projects and

deploying your code

• Create a custom build of WordPress that you keep in

a git repository which uses composer to track your

plugin dependencies

Page 31: WordPress Development Environments

Linux / Mac

• https://github.com/kiriaze/mac-dev-env

• https://gist.github.com/joshcummingsdesign/0f291b3

f73f1e3113227

• https://wpackagist.org/

Page 32: WordPress Development Environments

Native Stack - Pros

• Lightweight

• Quickly create new projects

• Works really well when your remote servers always

run a similar configuration

• Fast deploys that you can automate

Page 33: WordPress Development Environments

Native Stack - Cons

• More dependencies to manage

• Harder to hand your code over to another developer

unless they have the same build

Page 34: WordPress Development Environments

Virtual Machine

(VM)

Page 35: WordPress Development Environments

Virtual Box

Page 36: WordPress Development Environments

VM - Pros

• Easily create a configure a new server

• Reproduce any environment

• Completely destructible

• Completely decoupled

• Passes the 6 month & “works on mine” tests

Page 37: WordPress Development Environments

VM - Cons

• More overhead

Page 38: WordPress Development Environments

Vagrant

• Cross-platform

• Create a single file for your project to describe the

type of machine you want (provisioning file)

• One command to spin up an environment

• One command to deploy an environment

Page 39: WordPress Development Environments

VVV

• Varying Vagrant Vagrants

• Focused on WordPress development.

• Ideal for developing themes and plugins as well as

for contributing to WordPress core.

Page 40: WordPress Development Environments

VVV

• https://github.com/Varying-Vagrant-Vagrants/VVV

• https://make.wordpress.org/core/handbook/

Page 41: WordPress Development Environments

Trellis

• Developed by the Roots team

• Vagrant LEMP stack for WordPress with modern

development in mind

• Uses the power of Ansible to provision servers and

deploy with a single command

Page 42: WordPress Development Environments

Containers

Page 43: WordPress Development Environments

Docker

Page 44: WordPress Development Environments

Docker containers wrap up a piece of software in a complete

filesystem that contains everything it needs to run: code,

runtime, system tools, system libraries – anything you can

install on a server. This guarantees that it will always run the

same, regardless of the environment it is running in.

Page 45: WordPress Development Environments
Page 46: WordPress Development Environments

Docker

• Docker file

• Builds docker image

• Image sits on top of your machine

• Self-contained processes (microservices)

• Docker Hub

Page 47: WordPress Development Environments

Docker

ContainersVM

Page 48: WordPress Development Environments

Docker

• Modular

• VM-like features with less overhead

• Deploy very quickly because it only updates the new

information (like Git)

Page 49: WordPress Development Environments

Docker for WordPress

• Define the project (YAML)

• Curl WordPress tarball

• Create a wp-config.php

• Run docker-compose up

• Codeship for deployment

Page 50: WordPress Development Environments

Continuous Delivery

• Codeship

• Wercker

• Jenkins

Page 51: WordPress Development Environments

The Future