[ci/chromedriver] cache and restore in packer cache (#31047)

When building the packer cache, we should download the chromedriver install and make it available to master builds.
This commit is contained in:
Spencer 2019-02-16 13:56:56 -08:00 committed by GitHub
parent 9623c64547
commit 8f986619cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -13,6 +13,10 @@ cd "x-pack";
yarn gulp prepare;
cd -;
# cache the chromedriver bin
mkdir -p ".chromedriver/master"
cp node_modules/chromedriver/bin/chromedriver .chromedriver/master/
# archive cacheable directories
mkdir -p "$HOME/.kibana/bootstrap_cache"
tar -cf "$HOME/.kibana/bootstrap_cache/master.tar" \
@ -22,4 +26,5 @@ tar -cf "$HOME/.kibana/bootstrap_cache/master.tar" \
x-pack/plugins/*/node_modules \
x-pack/plugins/reporting/.chromium \
test/plugin_functional/plugins/*/node_modules \
.es;
.es \
.chromedriver;

View file

@ -104,6 +104,14 @@ yarnGlobalDir="$(yarn global bin)"
export PATH="$PATH:$yarnGlobalDir"
hash -r
###
### use the chromedriver cache if it exists
###
if [ -x "$dir/.chromedriver/master/chromedriver" ]; then
export CHROMEDRIVER_FILEPATH="$dir/.chromedriver/master/chromedriver"
export CHROMEDRIVER_SKIP_DOWNLOAD=true
fi
###
### install dependencies
###