INN / deploy-tools

Deployment tools for INN's WordPress sites
15 stars 6 forks source link

INN Deployment Tools

A box of tools for deploying INN's WordPress sites to WPEngine. Based on Chicago Tribune's deploy-tools.

Read documentation for all included commands here.

Prerequisites

You'll need Python (versions 2.5 to 2.7) and pip to get started with these tools. Virtualenv and virtualenvwrapper are not required, but using them is a good practice, so we'll use them here.

Set up python dev environment:

$ sudo easy_install pip
$ sudo pip install virtualenv
$ sudo pip install virtualenvwrapper
$ echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.zshrc

Change "~/.zshrc" to the appropriate rc file for your shell. If you're using bash: "~/.bashrc".

Open a new terminal window or tab and create a virtual environment for your project:

$ mkvirtualenv projectnamegoeshere --no-site-packages
$ workon projectnamegoeshere

Setup

If you're creating an INN-style umbrella repository for a Wordpress site or multisite, these tools are already included in the umbrella boilerplate.

If you're doing something else, read the setup docs.

Usage

These tools use Fabric.

To see a list of available commands:

$ fab -l

Commands are documented in COMMANDS.md

Deployment

See docs/deploy.md

A very long walk-through: https://gist.github.com/benlk/b75600e7243ac69f6e4275b65ba62d91

Local development

If you want your own VM for development work, check out docs/vagrant.md.

You can also use Varying Vagrant Vagrants with vv; INN umbrella repositories based off of INN/umbrella-boilerplate use that combination.

You can use Laravel Valet as well; the only difference is that you'll need to replace vagrant or dev commands with local ones. See the list of commands.

Database commands

These tools include a few commands to ease database setup and manipulation. Read about them here.

Installing and/or upgrading WordPress

In setting up your dev environment, you'll want to pull in all the necessary WordPress files if they are not included in the project repository. To do this, use the command:

$ fab wp.install:"4.8.1"

Where "4.8.1" identifies the tagged version of the WordPress repository that you want to use.

Fabric will download the release .zip file from Github and extract its contents to the project root.

The gitignore file included in the examples directory is a good starter for WordPress projects destined for deployment to WPEngine. It will help keep your project repo tidy by ignoring all WordPress core files that are unnecessary for deployment. Simply rename it to .gitignore to use it.