Skip to content

Commit

Permalink
Add ENV_VAR for overriding ES snapshot version (#28768)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover authored Jan 15, 2019
1 parent cfe8f3f commit 0ba1db2
Show file tree
Hide file tree
Showing 2 changed files with 13 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}`;
}
}
2 changes: 2 additions & 0 deletions src/dev/ci_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ fi
export KIBANA_DIR="$dir"
export XPACK_DIR="$KIBANA_DIR/x-pack"
export PARENT_DIR="$(cd "$KIBANA_DIR/.."; pwd)"
export TEST_ES_SNAPSHOT_VERSION="7.0.0-fbd1a09d"
echo "-> KIBANA_DIR $KIBANA_DIR"
echo "-> XPACK_DIR $XPACK_DIR"
echo "-> PARENT_DIR $PARENT_DIR"
echo "-> TEST_ES_SNAPSHOT_VERSION $TEST_ES_SNAPSHOT_VERSION"

###
### download node
Expand Down

0 comments on commit 0ba1db2

Please sign in to comment.