Skip to content

cmackler/automated-grunt-wordpress-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated WordPress Development and Deployment with Vagrant and Grunt

I created this grunt package to automate my local WordPress development workflow. Please read through this carefully!

This was designed to run in a Mac environment.

This package allows you to:

  • Automatically compile SASS/SCSS.
  • Pull /wp-content folder from your remote development/production websites into your local environment to get up and running quickly.
  • Push content from your local environment to your remote development/production websites.
  • Automatically sync your WordPress Database from local to remote and remote to local.

Prerequisites

You should have at least an intermediate knowledge of the command line before proceeding.

This package assumes that you have the following installed:

  1. Grunt
  2. VirtualBox
  3. Vagrant
  4. VVV (Varying-Vagrant-Vagrants). **Important - Use version 1.3.0 which can be downloaded HERE. The newest version has issues with this setup.
  5. Variable VVV
  6. LiveReload Extension for Chrome (allows you to see SASS/SCSS updates in Chrome without a Refresh.

*Note: Please make sure that you have SSH access to your development/production websites and that you BACKUP YOUR DATABASES until you are comfortable with this workflow!

If you are not familiar with running a Vagrant environment for WordPress development, a helpful guide can be found here: Setting up a WordPress VVV Vagrant Workflow

Getting Started

Copy the Gruntfile.js, package.json and site_settings.json into your theme directory. Once done, install the grunt packages by running $ npm install in your terminal window.

Next, you will need to configure your site_settings.json file. It's pretty self-explanatory, just follow the template. **Make sure to double-check all entries before transferring any files or databases.

Available Commands

  • $ grunt - Runs the watch command for compiling SASS/SCSS
  • $ grunt pull - Pulls remote wp-content folder into your local site
  • $ grunt push - Pushes local wp-content folder into your remote site
  • $ grunt push_theme - Pushes local theme into your remote site
  • $ grunt pull_db - Pulls remote database, searches and replaces site name, imports it into your local database *
  • $ grunt push_db - Pushes local database, searches and replaces site name, imports it into your remote database *

*Remeber to back up your databases until you are comfortable with this workflow!

The gruntfile can of course be modified to suit your needs.

About

WordPress development workflow with Grunt and VVV Vagrant

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published