2015-01-16 19:35:46 +01:00
|
|
|
var os = require('os');
|
2015-01-21 20:13:56 +01:00
|
|
|
var config = require('./utils/server-config');
|
|
|
|
|
2014-10-10 19:33:48 +02:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
grunt.registerTask('run_build', [
|
|
|
|
'build',
|
|
|
|
'_extract_built',
|
2014-10-10 19:46:06 +02:00
|
|
|
'run:built_kibana',
|
|
|
|
'_open_built_kibana',
|
|
|
|
'wait:built_kibana'
|
2014-10-10 19:33:48 +02:00
|
|
|
]);
|
|
|
|
|
2015-01-16 19:35:46 +01:00
|
|
|
var arch = os.arch();
|
|
|
|
var platform = os.platform();
|
2014-10-10 19:33:48 +02:00
|
|
|
var join = require('path').join;
|
|
|
|
var extract = require('./utils/spawn')(
|
|
|
|
'tar',
|
2014-10-17 21:26:02 +02:00
|
|
|
[
|
|
|
|
'-xzf',
|
2015-01-16 19:35:46 +01:00
|
|
|
grunt.config.process('<%= pkg.name %>-<%= pkg.version %>-' + platform + '-' + arch + '.tar.gz')
|
2014-10-17 21:26:02 +02:00
|
|
|
],
|
2014-10-10 19:33:48 +02:00
|
|
|
join(__dirname, '../target')
|
|
|
|
);
|
|
|
|
|
|
|
|
grunt.registerTask('_extract_built', function () {
|
|
|
|
extract().nodeify(this.async());
|
|
|
|
});
|
2014-10-10 19:46:06 +02:00
|
|
|
|
|
|
|
grunt.registerTask('_open_built_kibana', function () {
|
2015-02-05 23:40:44 +01:00
|
|
|
require('opn')('http://localhost:5601');
|
2014-10-10 19:46:06 +02:00
|
|
|
});
|
2015-01-16 19:35:46 +01:00
|
|
|
};
|