Skip to content

Commit

Permalink
Add ENV_VAR for overriding ES snapshot version (#28768) (#28770)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover authored Jan 15, 2019
1 parent 973eeb9 commit dffdb7a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/kbn-es/src/install/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exports.downloadSnapshot = async function installSnapshot({
log = defaultLog,
}) {
const fileName = getFilename(license, version);
const url = `https://snapshots.elastic.co/downloads/elasticsearch/${fileName}`;
const url = getUrl(fileName);
const dest = path.resolve(basePath, 'cache', fileName);

log.info('version: %s', chalk.bold(version));
Expand Down Expand Up @@ -150,3 +150,13 @@ function getFilename(license, version) {

return `${basename}-SNAPSHOT.${extension}`;
}

function getUrl(fileName) {
if (process.env.TEST_ES_SNAPSHOT_VERSION) {
return `https://snapshots.elastic.co/${
process.env.TEST_ES_SNAPSHOT_VERSION
}/downloads/elasticsearch/${fileName}`;
} else {
return `https://snapshots.elastic.co/downloads/elasticsearch/${fileName}`;
}
}

0 comments on commit dffdb7a

Please sign in to comment.