From 970b359f0c5f79bbab1d641b712fe4f86b1a8155 Mon Sep 17 00:00:00 2001 From: David Vega Fontelos Date: Sun, 14 Feb 2016 01:21:31 +0100 Subject: [PATCH 1/3] Fixes build for windows (cygwin) --- tasks/build/archives.js | 8 ++++---- tasks/build/shasums.js | 5 ++++- tasks/config/run.js | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tasks/build/archives.js b/tasks/build/archives.js index 2639ab86e28fc..ef50854e0d626 100644 --- a/tasks/build/archives.js +++ b/tasks/build/archives.js @@ -1,6 +1,6 @@ module.exports = function createPackages(grunt) { let { config } = grunt; - let { resolve } = require('path'); + let { resolve, relative } = require('path'); let { execFile } = require('child_process'); let { all, fromNode } = require('bluebird'); @@ -13,13 +13,13 @@ module.exports = function createPackages(grunt) { let archives = async (platform) => { // kibana.tar.gz - await exec('tar', ['-zchf', platform.tarPath, platform.buildName]); + await exec('tar', ['-zchf', relative(buildPath, platform.tarPath), platform.buildName]); // kibana.zip if (/windows/.test(platform.name)) { - await exec('zip', ['-rq', '-ll', platform.zipPath, platform.buildName]); + await exec('zip', ['-rq', '-ll', relative(buildPath, platform.zipPath), platform.buildName]); } else { - await exec('zip', ['-rq', platform.zipPath, platform.buildName]); + await exec('zip', ['-rq', relative(buildPath, platform.zipPath), platform.buildName]); } }; diff --git a/tasks/build/shasums.js b/tasks/build/shasums.js index c5dcedeba8f29..b24ccfefecc7a 100644 --- a/tasks/build/shasums.js +++ b/tasks/build/shasums.js @@ -1,6 +1,9 @@ var { promisify } = require('bluebird'); var readdir = promisify(require('fs').readdir); var exec = promisify(require('child_process').exec); +var platform = require('os').platform(); +var cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum '; + module.exports = function (grunt) { grunt.registerTask('_build:shasums', function () { @@ -11,7 +14,7 @@ module.exports = function (grunt) { // only sha the archives if (!archive.match(/\.zip$|\.tar.gz$/)) return; - return exec('shasum ' + archive + ' > ' + archive + '.sha1.txt', { + return exec(cmd + archive + ' > ' + archive + '.sha1.txt', { cwd: targetDir }); }) diff --git a/tasks/config/run.js b/tasks/config/run.js index 0d0be286c465c..bd4148162c398 100644 --- a/tasks/config/run.js +++ b/tasks/config/run.js @@ -4,6 +4,7 @@ module.exports = function (grunt) { let {resolve} = require('path'); let root = p => resolve(__dirname, '../../', p); let binScript = /^win/.test(platform) ? '.\\bin\\kibana.bat' : './bin/kibana'; + let buildedBinScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : '.build/kibana/bin/kibana'; let uiConfig = require(root('test/serverConfig')); const stdDevArgs = [ @@ -150,7 +151,7 @@ module.exports = function (grunt) { ready: /Optimization .+ complete/, quiet: true }, - cmd: './build/kibana/bin/kibana', + cmd: buildedBinScript, args: [ '--env.name=production', '--logging.json=false', From 1e07f74074d02f45f9d95c0a09fc22440dcf6d29 Mon Sep 17 00:00:00 2001 From: David Vega Fontelos Date: Sun, 14 Feb 2016 12:20:01 +0100 Subject: [PATCH 2/3] Fixes a typo --- tasks/config/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/config/run.js b/tasks/config/run.js index bd4148162c398..a879016736bb0 100644 --- a/tasks/config/run.js +++ b/tasks/config/run.js @@ -4,7 +4,7 @@ module.exports = function (grunt) { let {resolve} = require('path'); let root = p => resolve(__dirname, '../../', p); let binScript = /^win/.test(platform) ? '.\\bin\\kibana.bat' : './bin/kibana'; - let buildedBinScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : '.build/kibana/bin/kibana'; + let buildedBinScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : './build/kibana/bin/kibana'; let uiConfig = require(root('test/serverConfig')); const stdDevArgs = [ From dda24e0c9dd8a1f8d64974e60874694c252dc233 Mon Sep 17 00:00:00 2001 From: David Vega Fontelos Date: Thu, 25 Feb 2016 23:35:03 +0100 Subject: [PATCH 3/3] Renames the build script --- tasks/config/run.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/config/run.js b/tasks/config/run.js index a879016736bb0..fa61f23fdd88c 100644 --- a/tasks/config/run.js +++ b/tasks/config/run.js @@ -4,7 +4,7 @@ module.exports = function (grunt) { let {resolve} = require('path'); let root = p => resolve(__dirname, '../../', p); let binScript = /^win/.test(platform) ? '.\\bin\\kibana.bat' : './bin/kibana'; - let buildedBinScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : './build/kibana/bin/kibana'; + let buildScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : './build/kibana/bin/kibana'; let uiConfig = require(root('test/serverConfig')); const stdDevArgs = [ @@ -151,7 +151,7 @@ module.exports = function (grunt) { ready: /Optimization .+ complete/, quiet: true }, - cmd: buildedBinScript, + cmd: buildScript, args: [ '--env.name=production', '--logging.json=false',