Skip to content

Commit

Permalink
[kbn-es] Platform specific snapshots (#29673)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz authored and tylersmalley committed Feb 2, 2019
1 parent b44d1ad commit 61f9993
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packages/kbn-es/src/install/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,24 @@ function downloadFile(url, dest, log) {
}

function getFilename(license, version) {
const extension = os.platform().startsWith('win') ? 'zip' : 'tar.gz';
const basename = `elasticsearch${license === 'oss' ? '-oss-' : '-'}${version}`;
const platform = os.platform();
let suffix = null;
switch (platform) {
case 'darwin':
suffix = 'darwin-x86_64.tar.gz';
break;
case 'linux':
suffix = 'linux-x86_64.tar.gz';
break;
case 'win32':
suffix = 'windows-x86_64.zip';
break;
default:
throw new Error(`Unsupported platform ${platform}`);
}

return `${basename}-SNAPSHOT.${extension}`;
const basename = `elasticsearch${license === 'oss' ? '-oss-' : '-'}${version}`;
return `${basename}-SNAPSHOT-${suffix}`;
}

function getUrl(fileName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export default function ({ getService }) {
"stack_stats.kibana.timelion_sheet",
"stack_stats.kibana.versions",
"stack_stats.kibana.visualization",
"stack_stats.xpack.ccr",
"stack_stats.xpack.graph",
"stack_stats.xpack.ilm",
"stack_stats.xpack.logstash",
Expand Down

0 comments on commit 61f9993

Please sign in to comment.