Add release task to upload to S3

This commit is contained in:
Rashid Khan 2014-10-03 17:26:05 -07:00
parent 94914d3989
commit 9912738e38
4 changed files with 40 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
.aws-config.json
.DS_Store
node_modules
bower_components

View file

@ -39,7 +39,8 @@
"request": "^2.40.0",
"requirejs": "~2.1.14",
"rjs-build-analysis": "0.0.3",
"tar": "^1.0.1"
"tar": "^1.0.1",
"grunt-s3": "~0.2.0-alpha.3"
},
"scripts": {
"test": "grunt test --use-jruby",

19
tasks/config/s3.js Normal file
View file

@ -0,0 +1,19 @@
module.exports = function (config) {
return {
release: {
bucket: 'download.elasticsearch.org',
access: 'private',
//debug: true, // uncommment to prevent actual upload
upload: [
{
src: 'target/<%= pkg.name %>-<%= pkg.version %>.zip',
dest: 'kibana/kibana/<%= pkg.name %>-<%= pkg.version %>.zip',
},
{
src: 'target/<%= pkg.name %>-<%= pkg.version %>.tar.gz',
dest: 'kibana/kibana/<%= pkg.name %>-<%= pkg.version %>.tar.gz',
}
]
}
};
};

18
tasks/release.js Normal file
View file

@ -0,0 +1,18 @@
module.exports = function (grunt) {
// build, then zip and upload to s3
grunt.registerTask('release', [
'distribute:load_s3_config',
'build',
's3:release',
]);
// collect the key and secret from the .aws-config.json file, finish configuring the s3 task
grunt.registerTask('distribute:load_s3_config', function () {
var config = grunt.file.readJSON('.aws-config.json');
grunt.config('s3.options', {
key: config.key,
secret: config.secret
});
});
};