Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-applied PR 6267 to master to fix Windows/cygwin build #7141

Merged
merged 2 commits into from
May 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tasks/build/archives.js
Original file line number Diff line number Diff line change
@@ -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');

Expand All @@ -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]);
}
};

Expand Down
4 changes: 3 additions & 1 deletion tasks/build/shasums.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand All @@ -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
});
})
Expand Down
3 changes: 2 additions & 1 deletion tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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',
Expand Down