mapnik/scripts/ensure_test_data.sh

23 lines
973 B
Bash
Raw Permalink Normal View History

2016-09-06 00:00:37 -07:00
#!/usr/bin/env bash
set -eu
set -o pipefail
2016-09-07 19:53:01 -07:00
if [[ -f RELEASE_VERSION.md ]]; then
VERSION=$(cat RELEASE_VERSION.md)
2016-09-06 00:00:37 -07:00
if [[ ! -d ./test/data ]]; then
echo "Downloading unit test data from https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz"
2016-09-06 00:20:48 -07:00
mkdir -p test/data/
2016-09-07 19:53:01 -07:00
curl -f -L -s https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data/
2016-09-06 00:00:37 -07:00
fi
2016-09-06 00:20:48 -07:00
if [[ ! -d ./test/data-visual ]]; then
echo "Downloading visual test data from https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz"
mkdir -p test/data-visual/
2016-09-07 19:53:01 -07:00
curl -f -L -s https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data-visual/
2016-09-06 00:20:48 -07:00
fi
2016-09-07 19:53:01 -07:00
elif [[ -d .git ]]; then
git submodule update --init test/
else
echo "Expected either git clone directory (with .git) or release tarball with `RELEASE_VERSION.md` in root"
exit 1
2016-09-06 00:00:37 -07:00
fi