Skip to content

Instantly share code, notes, and snippets.

@jkarsrud
Last active August 29, 2015 14:27
Show Gist options
  • Save jkarsrud/4c02e156d99978917563 to your computer and use it in GitHub Desktop.
Save jkarsrud/4c02e156d99978917563 to your computer and use it in GitHub Desktop.
shipit from grunt
var exec = require('child_process').exec;
grunt.registerTask('deploy', 'Deploy to stage!', function(target) {
var done = this.async();
grunt.task.run(['foo', 'bar']);
// Requires globally installed shipit-cli
var cmd = 'shipit stage ' + target;
exec(cmd, function(err, stdout, stdin) {
if(err) {
console.error(err.message);
}
console.log(stdout)
done();
});
});
// Call it like so:
// grunt deploy:stage
// grunt deploy:production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment