[7.x] use chromedriver cache from bootstrap cache (#32825)

I'm working on setting up a bootstrap cache for 7.x as well as master, so we will be able to use the chromedriver cache once the images are updated.
This commit is contained in:
Spencer 2019-03-09 14:55:58 -08:00 committed by GitHub
parent 523d07aca9
commit c42f76b263
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

View file

@ -12,7 +12,7 @@ node scripts/es snapshot --download-only;
node scripts/es snapshot --license=oss --download-only;
# download reporting browsers
(cd x-pack && yarn gulp prepare);
(cd "x-pack" && yarn gulp prepare);
# cache the chromedriver bin
chromedriverDistVersion="$(node -e "console.log(require('chromedriver').version)")"
@ -41,9 +41,9 @@ tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \
echo "created $HOME/.kibana/bootstrap_cache/$branch.tar"
if [ "$branch" == "master" ]; then
echo "Creatting bootstrap cache for 7.x";
echo "Creating bootstrap cache for 7.x";
git clone https://github.com/elastic/kibana.git --branch 7.x --depth 1 /tmp/kibana-7.x
(cd /tmp/kibana-7.x; ./.ci/packer_cache.sh);
(cd /tmp/kibana-7.x && ./.ci/packer_cache.sh);
rm -rf /tmp/kibana-7.x;
fi

View file

@ -102,6 +102,27 @@ yarn config set yarn-offline-mirror "$cacheDir/yarn-offline-cache"
yarnGlobalDir="$(yarn global bin)"
export PATH="$PATH:$yarnGlobalDir"
###
### use the chromedriver cache if it exists
###
if [ -d "$dir/.chromedriver" ]; then
branchPkgVersion="$(node -e "console.log(require('./package.json').devDependencies.chromedriver)")"
cachedPkgVersion="$(cat "$dir/.chromedriver/pkgVersion")"
if [ "$cachedPkgVersion" == "$branchPkgVersion" ]; then
export CHROMEDRIVER_FILEPATH="$dir/.chromedriver/chromedriver.zip"
export CHROMEDRIVER_SKIP_DOWNLOAD=true
echo " -- Using chromedriver cache at $CHROMEDRIVER_FILEPATH"
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo " SKIPPING CHROMEDRIVER CACHE: cached($cachedPkgVersion) branch($branchPkgVersion)"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
fi
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo " CHROMEDRIVER CACHE NOT FOUND"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
fi
###
### install dependencies
###