node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



Deploy a git-versioned application to Heroku via AWS S3

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-git-s3-heroku --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:


The "git_s3_heroku" task


In your project's Gruntfile, add a section named git_s3_heroku to the data object passed into grunt.initConfig().

  git_s3_heroku: {
    options: {
      // Task-specific options go here. 
    your_target: {
      // Target-specific file lists and/or options go here. 

How it works

This plugin deploys a git-versioned application to Heroku via S3. Here's how it does it:

  1. run git describe to create a name for the package
  2. run git archive to create the package
  3. upload the package to AWS S3
  4. deploy the package to Heroku using the Heroku Platform API



Type: Array, Function Default value: []

Command line args to supply to git describe. Common options are --always and --dirty.
When a function is supplied it should return a string containing all args.


Type: String Default value: os.tmpdir()

The folder in which the temporary package is saved before being uploaded to S3.


Type: String Default value: process.env.AWS_ACCESS_KEY_ID

The AWS access key id.


Type: String Default value: process.env.AWS_SECRET_ACCESS_KEY

The AWS secret access key.


Type: String

The name of the AWS S3 bucket where to upload the packaged application.


Type: String Default value: public-read

The AWS S3 ACL to apply to the uploaded object.


Type: String

The name of the heroku application.


Type: String Default value: process.env.HEROKU_API_TOKEN

The API token to use to authenticate to the heroku platform API.

Usage Examples

  git_s3_heroku: {
    myApp: {
      gitDescribeArgs: ['--always'],
      s3Bucket: 'my-bucket',
      herokuAppName: 'my-app'


In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

03/06/2014 v0.1.0 Initial release