2018-11-16 07:39:53 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-11-29 11:59:22 +01:00
|
|
|
set -e
|
|
|
|
|
2019-03-08 22:24:40 +01:00
|
|
|
branch="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)"
|
|
|
|
|
2018-11-17 01:40:14 +01:00
|
|
|
# run setup script that gives us node, yarn, and bootstraps the project
|
2018-11-29 16:20:29 +01:00
|
|
|
source src/dev/ci_setup/setup.sh;
|
2018-11-17 01:40:14 +01:00
|
|
|
|
2018-11-26 19:33:33 +01:00
|
|
|
# download es snapshots
|
2018-11-17 01:40:14 +01:00
|
|
|
node scripts/es snapshot --download-only;
|
2019-03-08 22:24:40 +01:00
|
|
|
node scripts/es snapshot --license=oss --download-only;
|
2018-11-17 01:40:14 +01:00
|
|
|
|
2018-11-26 19:33:33 +01:00
|
|
|
# download reporting browsers
|
2019-03-09 23:55:58 +01:00
|
|
|
(cd "x-pack" && yarn gulp prepare);
|
2019-03-08 22:24:40 +01:00
|
|
|
|
2019-03-29 23:12:32 +01:00
|
|
|
# cache the chromedriver archive
|
2019-03-08 22:24:40 +01:00
|
|
|
chromedriverDistVersion="$(node -e "console.log(require('chromedriver').version)")"
|
|
|
|
chromedriverPkgVersion="$(node -e "console.log(require('./package.json').devDependencies.chromedriver)")"
|
|
|
|
if [ -z "$chromedriverDistVersion" ] || [ -z "$chromedriverPkgVersion" ]; then
|
|
|
|
echo "UNABLE TO DETERMINE CHROMEDRIVER VERSIONS"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-04-01 03:23:23 +02:00
|
|
|
mkdir -p .chromedriver
|
2019-03-08 22:24:40 +01:00
|
|
|
curl "https://chromedriver.storage.googleapis.com/$chromedriverDistVersion/chromedriver_linux64.zip" > .chromedriver/chromedriver.zip
|
|
|
|
echo "$chromedriverPkgVersion" > .chromedriver/pkgVersion
|
2018-11-26 19:33:33 +01:00
|
|
|
|
2019-07-20 07:58:35 +02:00
|
|
|
# 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
|
|
|
|
|
2018-11-17 01:40:14 +01:00
|
|
|
# archive cacheable directories
|
|
|
|
mkdir -p "$HOME/.kibana/bootstrap_cache"
|
2019-03-08 22:24:40 +01:00
|
|
|
tar -cf "$HOME/.kibana/bootstrap_cache/$branch.tar" \
|
2018-11-17 01:40:14 +01:00
|
|
|
node_modules \
|
|
|
|
packages/*/node_modules \
|
|
|
|
x-pack/node_modules \
|
2019-06-19 00:13:00 +02:00
|
|
|
x-pack/legacy/plugins/*/node_modules \
|
2020-06-04 05:50:23 +02:00
|
|
|
x-pack/plugins/reporting/.chromium \
|
2018-12-05 16:45:19 +01:00
|
|
|
test/plugin_functional/plugins/*/node_modules \
|
2019-12-11 16:38:49 +01:00
|
|
|
examples/*/node_modules \
|
2019-03-08 22:24:40 +01:00
|
|
|
.es \
|
2019-07-20 07:58:35 +02:00
|
|
|
.chromedriver \
|
|
|
|
.geckodriver;
|
2019-03-08 22:24:40 +01:00
|
|
|
|
|
|
|
echo "created $HOME/.kibana/bootstrap_cache/$branch.tar"
|
|
|
|
|
|
|
|
if [ "$branch" == "master" ]; then
|
2019-03-09 23:55:58 +01:00
|
|
|
echo "Creating bootstrap cache for 7.x";
|
2019-03-08 22:24:40 +01:00
|
|
|
|
|
|
|
git clone https://github.com/elastic/kibana.git --branch 7.x --depth 1 /tmp/kibana-7.x
|
2019-03-09 23:55:58 +01:00
|
|
|
(cd /tmp/kibana-7.x && ./.ci/packer_cache.sh);
|
2019-03-08 22:24:40 +01:00
|
|
|
rm -rf /tmp/kibana-7.x;
|
|
|
|
fi
|