I recently joined Carrie Dils for an Office Hours discussion about workflows. Here’s a quick summary of what we discussed.
Listen to the Podcast
We discuss all things code, from templates and automation to my perspective on time management.
I have two starter themes: EA Starter, a heavily-modified, underscores-based theme; and EA Genesis Child, a Genesis child theme. Both are structured very similarly. EA Starter uses hooks from Theme Hook Alliance to make it more Genesis-like. I’d say about half my projects are Genesis-based, and the other half are custom WordPress themes.
I like to use CodeKit for SASS compiling, JS concatenation and minification, and live refreshing. For projects where you are collaborating with other developers, keeping environments and build processes in sync is more important, and CodeKit might not be a good fit. But as a solo developer it works great for me.
- Pushes code to GitHub.
- Pushes code to correct WPEngine remote branch (production or staging), as defined by
- Pushes database & media using WP Migrate DB Pro (
wp migratedb profile 1).
Since the cli command only accepts profile IDs, I need to make sure I create the profiles in the right order. My initial setup is:
- Create a local WP environment (ex: clientname.local )
- Create a transferrable install on WPEngine (ex: clientname.wpengine.com )
- Make sure WP Migrate DB Pro is installed in both environments and configured to allow push and pull
- On local environment, go to Tools > Migrate DB Pro, select “push”, paste in the connection info, check “Media Files”, and save profile (I name it “WPE Push”).
- Create a new profile, same settings but for “Pull”. I name it “WPE Pull”.
Editing Production Sites
If the client is hosted at WPEngine, then we can use git to push code changes to staging and production environments (more information).
If they are hosted elsewhere, we use DeployHQ to push code changes to their server. The free plan (10 deployments per day) is plenty for most production sites.
When working with large sites, moving media back and forth can be difficult. In these cases I’ll often install BE Media from Production. It updates all (or some) media URLs to use the production URL. On my local install I can just have the themes and plugins installed, but all the images still display correctly.