Add ENV_VAR for overriding ES snapshot version (#28768) (#28770)

This commit is contained in:
Josh Dover 2019-01-15 16:52:19 -06:00 committed by GitHub
parent 973eeb9a1d
commit dffdb7a714
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));
@ -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}`;
}
}