- Iterate and deploy changes faster
- Make the code more stable
- Make the code more performant
Boiling it down, I was in need of a solution that automated the following:
- Compile/minify Sass/SCSS files into CSS.
- Copied all compiled assets and other resources into a temporary directory
- Easily zip up the contents of the temp directory into a .resource file
- Deploy the .resource file to force.com using the force.com migration tool
Grunt.js is a task-based, configuration-based, build tool. While this is still a relatively new technology, grunt already hava a vast community built around the tool and plugins to do just about whatever you want to do. I selected grunt for my needs because of its “configuration vs scripting” approach to project builds. It allows me to quickly make major changes to my build steps with minimal tweaks to my Gruntfile configuration.
We chose grunt because it took care of steps 1-6 above with a combination of plugins and configurations. For the force.com deployment step(s), I wrote my own plugin to satisfy step 7.
I wrote this plugin last week to allow for force.com deployments as grunt tasks. I plan to expand this to also manage other metadata api operations such as retrieves but for now, the only task in there is antdeploy. For more information on the plugin, check out the project on Github. I’m also looking for some contributors on it so fork away!
Here is a video I did showing how this all works together.
Files from the Demo
And the files that I used…
If you are new to grunt, check out these links to get you started: