Skip to content

Commit

Permalink
added release task to gruntfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Oct 17, 2013
1 parent 928332b commit 18ee2fa
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,42 @@ module.exports = function (grunt) {
dest: '<%= pkg.name %>-latest'
}
]
},
zip_release: {
options: {
archive: '<%= tempDir %>/<%= pkg.name %>-<%= pkg.version %>.zip'
},
files : [
{
expand: true,
cwd: '<%= destDir %>',
src: ['**/*'],
dest: '<%= pkg.name %>-<%= pkg.version %>'
},
{
expand: true,
src: ['LICENSE.md', 'README.md'],
dest: '<%= pkg.name %>-<%= pkg.version %>'
}
]
},
tgz_release: {
options: {
archive: '<%= tempDir %>/<%= pkg.name %>-<%= pkg.version %>.tar.gz'
},
files : [
{
expand: true,
cwd: '<%= destDir %>',
src: ['**/*'],
dest: '<%= pkg.name %>-<%= pkg.version %>'
},
{
expand: true,
src: ['LICENSE.md', 'README.md'],
dest: '<%= pkg.name %>-<%= pkg.version %>'
}
]
}
},
s3: {
Expand All @@ -206,6 +242,21 @@ module.exports = function (grunt) {
dest: 'kibana/kibana/<%= pkg.name %>-latest.tar.gz',
}
]
},
release: {
bucket: 'download.elasticsearch.org',
access: 'private',
// debug: true, // uncommment to prevent actual upload
upload: [
{
src: '<%= tempDir %>/<%= pkg.name %>-<%= pkg.version %>.zip',
dest: 'kibana/kibana/<%= pkg.name %>-<%= pkg.version %>.zip',
},
{
src: '<%= tempDir %>/<%= pkg.name %>-<%= pkg.version %>.tar.gz',
dest: 'kibana/kibana/<%= pkg.name %>-<%= pkg.version %>.tar.gz',
}
]
}
}
};
Expand Down Expand Up @@ -306,6 +357,16 @@ module.exports = function (grunt) {
'clean:temp'
]);

// build, then zip and upload to s3
grunt.registerTask('release', [
'distribute:load_s3_config',
'build',
'compress:zip_release',
'compress:tgz_release',
's3:release',
'clean:temp'
]);

// 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');
Expand Down

0 comments on commit 18ee2fa

Please sign in to comment.