From 203c7adadc7da9d5b17f9401bb73183519df0ff6 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 5 May 2016 10:35:07 -0500 Subject: [PATCH 1/2] Re-applied PR 6267 to master to fix Windows/cygwin build --- tasks/build/archives.js | 8 ++++---- tasks/build/shasums.js | 4 +++- tasks/config/run.js | 3 ++- 3 files changed, 9 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..84f68eb40fdb2 100644 --- a/tasks/build/shasums.js +++ b/tasks/build/shasums.js @@ -1,6 +1,8 @@ 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 +13,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 e98bfe894e725..c2df1422f3b8a 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 buildScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : './build/kibana/bin/kibana'; let uiConfig = require(root('test/server_config')); const stdDevArgs = [ @@ -150,7 +151,7 @@ module.exports = function (grunt) { ready: /Optimization .+ complete/, quiet: true }, - cmd: './build/kibana/bin/kibana', + cmd: buildScript, args: [ '--env.name=production', '--logging.json=false', From 82b06cd464b2e37d30c980614dcf5a18300eaff5 Mon Sep 17 00:00:00 2001 From: LeeDr Date: Thu, 5 May 2016 10:46:13 -0500 Subject: [PATCH 2/2] Minor update to CONTRIBUTING.md for required Cygwin packages on Windows. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1511d6b60b77d..59c1f9542ebd1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ Please make sure you have signed the [Contributor License Agreement](http://www. npm run elasticsearch ``` -- Start the development server. _On Windows, you'll need you use Git Bash, Cygwin, or a similar shell that exposes the `sh` command._ +- Start the development server. _On Windows, you'll need you use Git Bash, Cygwin, or a similar shell that exposes the `sh` command. And to successfully build you'll need Cygwin optional packages zip, tar, and shasum._ ```sh npm start