$30 off During Our Annual Pro Sale. View Details »

WordCamp St Louis 2014

WordCamp St Louis 2014

My chat on speeding up your theme development workflow with automation. I showed some tools I use regularly YeoPress Grunt and Git for installation, live reload and compiling as well as basic deployments.

Joshua Ray

March 01, 2014
Tweet

More Decks by Joshua Ray

Other Decks in Programming

Transcript

  1. Adding Automation to your theme development workflow Joshua Ray WordCamp

    St. Louis 2014 @pdxOllo http://ollomedia.com http://github.com/Ollo
  2. Hi

  3. Take the repetitive tasks for every WP project set up

    localhost set up local database find WP core or download again because you can’t remember where you saved it last. run 5 minute install install favorite theme or boiler install favorite plugins build push to git set up WP on remote server { dev, staging, production } install favorite plugins use ftp? to upload modified theme / boiler for review
  4. As an engineer, there is a short list of tools

    that you must be rabid about. Rabid. Foaming at the mouth crazy. ~Michael Lopp
  5. $ npm install -g yo $ npm install -g yo

    generator-wordpress $ yo wordpress
  6. <?php // Init vars $LOCAL_ROOT = "/var/www/my_new_site"; $LOCAL_REPO_NAME = "public_html";

    $LOCAL_REPO = "{$LOCAL_ROOT}/{$LOCAL_REPO_NAME}"; $REMOTE_REPO = "[email protected]:jonathanstark/my_new_site.git"; $DESIRED_BRANCH = "dev"; // Delete local repo if it exists if (file_exists($LOCAL_REPO)) { shell_exec("rm -rf {$LOCAL_REPO}"); } // Clone fresh repo from github using desired local repo name and checkout the desired branch echo shell_exec("cd {$LOCAL_ROOT} && git clone {$REMOTE_REPO} {$LOCAL_REPO_NAME} && cd {$LOCAL_REPO} && git checkout {$BRANCH}"); die("done " . mktime());
  7. scheme: sftp host: example.com username: user password: pass path: path/to/deployment

    exclude: - .gitignore - dandelion.yml - folder/ additional: - public/css/print.css - public/css/screen.css - public/js/main.js
  8. $ git commit -am “my new feature” $ git push

    origin master $ dandelion deploy