kibana/tasks/config/compress.js
Chris Cowan 5d39d334ea Closes #355 - Make bin/kibana executable in the tar and zip archives
grunt-compress is broken it does not honor the `mode` option when tyring
to set the permissions on a file. This is broken through out the entire
Grunt project (grunt-contrib-copy doesn't honor it, grunt-replace
doesn't honor it... as far as I can tell nothing does). SO instead of
wasting more time trying to get it to work (I already wasted an hour on
it) I decided to fall back to just writing a 10 minute script that
actually works. If you are intent on using a pure Grunt task to make it
work feel free to go do that rabit hole.
2014-09-23 07:02:34 -07:00

50 lines
1.2 KiB
JavaScript

module.exports = function (grunt) {
var _ = require('lodash');
var archiveName = function (plugin) {
return '<%= target %>/<%= pkg.name %>-' + (plugin ? 'plugin-' : '') + '<%= pkg.version %>';
};
return _.mapValues({
build_zip: archiveName() + '.zip',
build_tarball: archiveName() + '.tar.gz',
plugin: archiveName(true) + '.tar.gz'
}, function (filename, task) {
return {
options: {
archive: filename
},
files: [
{
flatten: true,
src: '<%= build %>/dist/bin/kibana',
dest: '<%= pkg.name %>/bin/kibana',
mode: 755
},
{
flatten: true,
src: '<%= build %>/dist/bin/kibana.bat',
dest: '<%= pkg.name %>/bin/kibana.bat'
},
{
expand: true,
cwd: '<%= build %>/dist/config',
src: ['**/*'],
dest: '<%= pkg.name %>/config'
},
{
expand: true,
cwd: '<%= build %>/dist/lib',
src: ['**/*'],
dest: '<%= pkg.name %>/lib'
},
{
expand: true,
cwd: '<%= build %>/dist',
src: ['*.txt'],
dest: '<%= pkg.name %>'
}
]
};
});
};