Skip to content

Instantly share code, notes, and snippets.

@gergelyke
Last active March 27, 2017 09:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gergelyke/9070420 to your computer and use it in GitHub Desktop.
Save gergelyke/9070420 to your computer and use it in GitHub Desktop.
Uploading to S3, Cloudfront invalidation, HipChat notification
{
"accessKeyId": "akid",
"secretAccessKey": "secret",
"region": "us-east-1"
}
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
s3: {
options: {
region: 'us-east-1',
endpoint: 's3.amazonaws.com',
access: 'public-read',
headers: { 'Cache-Control': 'max-age=60' },
gzip: true,
bucket: 'bucketname'
},
upload: [
{
src: 'path/to/builtlib.js',
dest: 'path/in/s3/lib.js'
}
]
},
cloudfront:
options: {
credentials: grunt.file.readJSON('credentials.json'),
region: 'us-east-1',
distributionId: "YOUR_DISTRIBUTION_ID",
listInvalidations: true
},
paths: [
'url/of/cloudfront/lib.js'
]
},
hipchat_notifier: {
options: {
authToken: "", // your authtoken
roomId: "" // Numeric Hipchat roomId
},
deployed: {
message: 'Wow, deployed!',
from: 'Wizard of Grunt',
color: 'red'
}
}
});
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-cloudfront');
grunt.loadNpmTasks('grunt-hipchat-notifier');
grunt.registerTask('deploy', ['s3', 'cloudfront', 'hipchat_notifier']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment