moved the aws config out of the general gruntfile setup, and into a task that is only run when needed.

This commit is contained in:
Spencer Alger 2013-09-19 08:09:04 -07:00
parent 822ef96a7e
commit c767ae6645

View File

@ -4,7 +4,6 @@ module.exports = function (grunt) {
var config = { var config = {
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
aws: grunt.file.readJSON('.aws-config.json'),
srcDir: 'src', srcDir: 'src',
destDir: 'dist', destDir: 'dist',
tempDir: 'tmp', tempDir: 'tmp',
@ -170,12 +169,6 @@ module.exports = function (grunt) {
} }
}, },
s3: { s3: {
options: {
key: '<%= aws.key %>',
secret: '<%= aws.secret %>',
bucket: 'download.elasticsearch.org',
access: 'private'
},
dist: { dist: {
upload: [ upload: [
{ {
@ -267,12 +260,23 @@ module.exports = function (grunt) {
]); ]);
grunt.registerTask('distribute', [ grunt.registerTask('distribute', [
'load_s3_config',
'build', 'build',
'zip:dist', 'zip:dist',
's3:dist', 's3:dist',
'clean:temp' 'clean:temp'
]); ]);
grunt.registerTask('load_s3_config', function () {
var config = grunt.file.readJSON('.aws-config.json');
grunt.config('s3.options', {
key: config.key,
secret: config.secret,
bucket: 'download.elasticsearch.org',
access: 'private'
});
});
grunt.registerTask('write_revision_to_dest', function() { grunt.registerTask('write_revision_to_dest', function() {
grunt.event.once('git-describe', function (desc) { grunt.event.once('git-describe', function (desc) {
grunt.config('string-replace.config', { grunt.config('string-replace.config', {