Last active
March 27, 2017 09:47
-
-
Save gergelyke/9070420 to your computer and use it in GitHub Desktop.
Uploading to S3, Cloudfront invalidation, HipChat notification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"accessKeyId": "akid", | |
"secretAccessKey": "secret", | |
"region": "us-east-1" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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