Skip to content

Commit

Permalink
Added an S3 deployment plugin which pushesh to the code asset store.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirRawlins committed Nov 7, 2013
1 parent 4ecc836 commit 3c73016
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,4 +1,5 @@
.DS_Store
/tmp
/node_modules
npm-debug.log
npm-debug.log
aws.json
30 changes: 29 additions & 1 deletion Gruntfile.js
Expand Up @@ -4,6 +4,7 @@ module.exports = function(grunt) {
grunt.initConfig({
// Default package configuration.
pkg: grunt.file.readJSON('package.json'),
aws: grunt.file.readJSON('aws.json'),

// Javascript validation.
jshint: {
Expand Down Expand Up @@ -31,7 +32,32 @@ module.exports = function(grunt) {
options: {
npmtag: false // Don't deploy to NPM as we don't want to release like that.
}
}
},

// Deployment.
s3: {
options: {
key: '<%= aws.key %>',
secret: '<%= aws.secret %>',
bucket: 'code.sorryapp.com',
region: 'eu-west-1',
access: 'public-read',
},
dev: {
upload: [
{
src: 'dist/<%= pkg.name %>.min.js',
dest: '<%= pkg.name %>/<%= pkg.version %>/<%= pkg.name %>.min.js',
options: { gzip: true }
},
{
src: 'dist/<%= pkg.name %>.min.css',
dest: '<%= pkg.name %>/<%= pkg.version %>/<%= pkg.name %>.min.css',
options: { gzip: true }
}
]
}
}
});

// Load the plugin that provides the "uglify" task.
Expand All @@ -42,6 +68,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
// Release tasks to manage version number bump, tag etc.
grunt.loadNpmTasks('grunt-release');
// AWS/S3 deployment tools.
grunt.loadNpmTasks('grunt-s3');

// Default task(s).
grunt.registerTask('default', ['jshint', 'uglify', 'cssmin']);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -12,6 +12,7 @@
"grunt-contrib-uglify": "~0.2.5",
"grunt-contrib-jshint": "~0.7.1",
"grunt-release": "~0.6.0",
"grunt-contrib-cssmin": "~0.7.0"
"grunt-contrib-cssmin": "~0.7.0",
"grunt-s3": "~0.2.0-alpha.3"
}
}

0 comments on commit 3c73016

Please sign in to comment.