Using Roots 7.0 with Git deploy

I’m using Roots 7.0 on a host where I Git Deploy (WPEngine). The new grunt workflow creates scripts, css and the manifest.json files, but all of those are commented out in .gitignore. Since they never make it in to my repo, they never get deployed when I push to the production servers.

I assume the solution is to just remove the relevant lines in gitignore so that these can be versioned. I understand the desirability of not having to commit these generated assets, but for those of us using a Git deployment mechanism, I don’t see any other way to make this work.

I haven’t check out Roots 7.0 but I used Git for my WordPress deployment workflow with both Pagodabox and Bedrock on EC2. Feels like I’m missing something here with the new release, is there a change in workflow?

Normally I would just run grunt dev and just deploy like usual.

That’s seems fine since that’s how it worked before version 7 anyway

See: https://github.com/roots/roots/blob/master/README.md#theme-development

grunt build — Create minified assets that are used on non-development environments

I moved 9 posts to a new topic: Capistrano: run Grunt locally and upload files

I have been relentlessly practicing this new Git deploy workflow to demonstrate it at my upcoming talk at WordCamp LAX. This is what I have and please let me know if I am making any errors or being redundant. I am primarily a designer and front-end developer, so I am learning as I go along with a lot of these new technologies Roots has been adopting.

###Services/Software used

For the purposes of this example, I am renaming the theme as ‘demo’.

####Part I: Github setup

  1. Create a repository at github.com named ‘demo’
  • Clone Roots repository from github.com to desktop as ‘demo’
  • Change local Roots clone settings as follows:
    • Change Primary remote repository (origin) to: https://github.com/shaimoom/demo.git (from github.com repo)
    • Delete the following from Ignored files (.gitignore):
      • assets/css/*main*.css
      • assets/js/*scripts*.js
      • assets/js/vendor/modernizr.min.js
      • assets/manifest.json
  • Sync the local and remote repositories (initial commit)

####Part II: Local Dev Setup, Install Dependencies & Grunt

  1. Add define('WP_ENV', 'development'); to the WordPress installation wp-config.php
  • Right-click on the ‘demo’ repository in Github and select ‘Open in Terminal’
  • Run npm install on theme root directory (vendor assets will be added to the theme)
  • Run grunt watch on theme root directory in terminal to track changes
  • Activate theme
  • Customize theme

####Part III: Deployment

  1. Remove define('WP_ENV', 'development'); in the WordPress installation wp-config.php
  • Run grunt build and commit in Github (minified assets will be generated for production)
  • Add SSH & SFTP info to Deploy (including theme file path)
  • Deploy from latest commit
  • Activate theme on production site
  • Win?

Repeat Part II and Part III during local development.

Your comments are appreciated.

As I am looking at this, I am seeing that there may be some unnecessary steps with grunt in my workflow. Particularly Step 1 and Step 2 in Part III.

How can I add the tasks executed by grunt build into grunt watch? This way, I do not have to adjust wp-config.php and can simply deploy after saving customizations to the theme.