Skip to content

Instantly share code, notes, and snippets.

@abuiles
Created October 8, 2014 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abuiles/83b260c5fca5c6378a6c to your computer and use it in GitHub Desktop.
Save abuiles/83b260c5fca5c6378a6c to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
env: process.env,
s3: {
options: {
key: '<%= env.AWS_ACCESS_KEY_ID %>',
secret: '<%= env.AWS_SECRET_ACCESS_KEY %>',
bucket: '<%= env.AWS_BUCKET %>',
access: 'public-read',
headers: {
"Cache-Control": "max-age=630720000, public",
"Expires": new Date(Date.now() + 630720000).toUTCString()
},
},
dev: {
upload: [
{
src: 'dist/assets/**/*',
dest: 'mims-app/assets/',
rel: 'dist/assets',
options: { verify: true }
}
]
}
},
redis: {
options: {
manifestKey: 'releases',
manifestSize: 10,
host: '<%= env.REDISTOGO_HOST %>',
port: '<%= env.REDISTOGO_PORT %>',
connectionOptions: {
auth_pass: '<%= env.REDISTOGO_PASSWORD %>'
}
},
canary: {
options: {
prefix: '<%= gitinfo.local.branch.current.shortSHA %>:',
currentDeployKey: '<%= gitinfo.local.branch.current.shortSHA %>',
},
files: {
src: ["dist/index.html"]
}
},
release: {
options: {
prefix: 'release:'
},
files: {
src: ["dist/index.html"]
}
}
},
});
grunt.loadNpmTasks('grunt-gitinfo');
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-redis');
grunt.registerTask('release', ['gitinfo', 'redis:release']);
grunt.registerTask('canary', ['gitinfo', 'redis:canary']);
grunt.registerTask('deploy-release', ['default', 'release']);
return grunt.registerTask('default', ['gitinfo', 's3:dev', 'canary']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment