Automated Envato theme deployment with Grunt.js

wordpress

#1

Wow Grunt is powerful!

Just made a small CSS fix to my theme. Ran grunt build and it:

  • formatted all my code to WordPress standards
  • added correct text domain to all __() and _e() calls
  • generated POT file
  • compressed all images
  • generated .css files from .less (with map file for chrome live editing)
  • added style.css header with current theme details and updated version number
  • looped through all my custom theme-plugins/*, formatted code, text domain, POT, plugin headers, then zipped up each plugin into a theme plugins/ folder ready for TGM activation
  • set the TGM plugin activation array based on settings in a theme.json file
  • saved the change log to the theme.json file for later parsing (documentation / description)
  • built the updated documentation from a mustache template (with new version number and change log) and pushed to gh-pages hosting
  • built the updated item description from a mustache template (with new version number and change log) and saved to HTML file ready for manual item submission.
  • zipped up final WordPress theme into a theme-version.zip file
  • zipped up final WordPress theme, photoshop files, documentation and other resources into a full-download-version.zip file
  • added a “Version xyz - Date” overlay to the item graphic
  • zipped up new screenshots including the updated item graphic with version number
  • uploaded all these zip files to Envato FTP
  • notifies me when upload is complete so I can login, paste the updated item description, select the zip files and submit for approval.
  • sends the whole thing to github

:wink:

Go learn grunt. Automation can be very powerful.


#2

Hey!)

Good stuff, though i’m using Gulp instead of Grunt.
I’m also running Python to help me bundle all things up, for example to create placeholders very very fast :slight_smile:


#3

Wish I would have started with Gulp. Some things would have been much easier to implement. If I re-write this at any point I’ll use Gulp.


#4

:slight_smile: Been doing almost the same thing with Grunt for quite a while.


#5

Thanks for sharing these information, i will give a try to that glup or gunt…never tried that before…any guide will be very helpful

Thanks


#6

I just started learning Grunt over the last few days and wow very powerful. Most of the items on your list I have been curious if Grunt could handle, but not sure where to start.

Would you mind posting in the Gruntfile.js you are using for this setup so we could have a look at the grunt plugins and configuration you are using for this automation.

thanks


#7

And I’m here still learning sass. haha


#8

+1 pretty please … :wink:


#9

I was using similar workflow to zip and deploy zip to envato ftp but problem with grunt zip plugin is many times it generates corrupted zip files and one time I had accidently loaded the main corrupted zip. So be sure to check zip before loading :wink:


#10

How was the Grunt code look like for doing the above task?

only “grunt build” ??


#11

My grunt file is 961 lines long and contains quite a lot of tricks dependant on my dev environment. I’ll try to work up a little example that is worth sharing.


#12

Hi @dtbaker,

Please post the file or upload it somewhere we will look into this and pick what needed.

Thanks