WordPress local development using WP Stack
I’ve been working with a local development extension of WP Stack for a couple months at Knewton, and this now my workflow. I can usually develop in local master, but when needed I’ll work in a local development branch first.
My point is, it’s much simpler to do this than it used to be—so easy a marketing guy can do it. I don’t know of many places where the marketing team has developed this level of self-sufficiency.
- Open iTerm2
The dev guys told me this is better than Terminal. I use these three panes to manage my stuff. They use like 12.
- “marketing-deploy” is a private repo (hosted on Github) that handles all our deployment configuration
- “vagrant” is Vagrant, which handles virtualized development. I’m basically running a second computer on my computer.
- “knewton.com” is a copy of our WordPress-based site, including database and server configs
Fetch and merge from the repo’s origin (Github)
Boot up the Vagrant virtualization
Sync the database from production to local
vagrant knewton:localdev on
Change my hosts file to point www.knewton.com to my local version
- Do some work
- preview my work on www.knewton.com
vagrant knewton:localdev off
Revert hosts file
Shut down the Vagrant virtualization
- ssh to the admin box
The admin box is a separate instance hosted on AWS that handles deployment, rollback, restarting nginx/memcached/etc., and more with single-line commands
- switch to the deploy user