Skip to content

Commit

Permalink
[7.2] Use custom GECKODRIVER_CDNURL (#41513) (#41550)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored Jul 19, 2019
1 parent cd19911 commit 25f77f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
13 changes: 1 addition & 12 deletions .ci/packer_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@ mkdir -p .chromedriver
curl "https://chromedriver.storage.googleapis.com/$chromedriverDistVersion/chromedriver_linux64.zip" > .chromedriver/chromedriver.zip
echo "$chromedriverPkgVersion" > .chromedriver/pkgVersion

# cache the geckodriver archive
geckodriverPkgVersion="$(node -e "console.log(require('./package.json').devDependencies.geckodriver)")"
if [ -z "$geckodriverPkgVersion" ]; then
echo "UNABLE TO DETERMINE geckodriver VERSIONS"
exit 1
fi
mkdir -p ".geckodriver"
cp "node_modules/geckodriver/geckodriver.tar.gz" .geckodriver/geckodriver.tar.gz
echo "$geckodriverPkgVersion" > .geckodriver/pkgVersion

# archive cacheable directories
mkdir -p "$HOME/.kibana/bootstrap_cache"
tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \
Expand All @@ -45,8 +35,7 @@ tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \
x-pack/plugins/reporting/.chromium \
test/plugin_functional/plugins/*/node_modules \
.es \
.chromedriver \
.geckodriver;
.chromedriver;

echo "created $HOME/.kibana/bootstrap_cache/$branch.tar"

Expand Down
21 changes: 2 additions & 19 deletions src/dev/ci_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,8 @@ else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
fi

###
### use the geckodriver cache if it exists
###
if [ -d "$dir/.geckodriver" ]; then
branchPkgVersion="$(node -e "console.log(require('./package.json').devDependencies.geckodriver)")"
cachedPkgVersion="$(cat "$dir/.geckodriver/pkgVersion")"
if [ "$cachedPkgVersion" == "$branchPkgVersion" ]; then
export GECKODRIVER_FILEPATH="$dir/.geckodriver/geckodriver.tar.gz"
echo " -- Using geckodriver cache at '$GECKODRIVER_FILEPATH'"
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo " SKIPPING GECKODRIVER CACHE: cached($cachedPkgVersion) branch($branchPkgVersion)"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
fi
else
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo " GECKODRIVER CACHE NOT FOUND"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
fi
# use a proxy to fetch geckodriver asset
export GECKODRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/geckodriver_cache"

###
### install dependencies
Expand Down

0 comments on commit 25f77f4

Please sign in to comment.