diff --git a/Makefile b/Makefile index fd3a2add4..910951d7b 100755 --- a/Makefile +++ b/Makefile @@ -17,24 +17,7 @@ install: $(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install release: - export MAPNIK_VERSION=$(shell ./utils/mapnik-config/mapnik-config --version) && \ - export TARBALL_NAME="mapnik-v$${MAPNIK_VERSION}" && \ - cd /tmp/ && \ - rm -rf $${TARBALL_NAME} && \ - git clone --depth 1 --branch v$${MAPNIK_VERSION} git@github.com:mapnik/mapnik.git $${TARBALL_NAME} && \ - cd $${TARBALL_NAME} && \ - git checkout "tags/v$${MAPNIK_VERSION}" && \ - git submodule update --depth 100 --init && \ - rm -rf deps/mapbox/variant/.git && \ - rm -rf test/data/.git && \ - rm -rf test/data/.gitignore && \ - rm -rf test/data-visual/.git && \ - rm -rf test/data-visual/.gitignore && \ - rm -rf .git && \ - rm -rf .gitignore && \ - cd ../ && \ - tar cjf $${TARBALL_NAME}.tar.bz2 $${TARBALL_NAME}/ && \ - aws s3 cp --acl public-read $${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v$${MAPNIK_VERSION}/ + ./scripts/publish_release.sh python: if [ ! -d ./bindings/python ]; then git clone git@github.com:mapnik/python-mapnik.git --recursive ./bindings/python; else (cd bindings/python && git pull && git submodule update --init); fi; @@ -95,10 +78,13 @@ rebuild: uninstall: @$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 uninstall -test/data: - git submodule update --init +test/data-visual: + ./scripts/ensure_test_data.sh -test: ./test/data +test/data: + ./scripts/ensure_test_data.sh + +test: ./test/data test/data-visual @./test/run check: test diff --git a/scripts/ensure_test_data.sh b/scripts/ensure_test_data.sh new file mode 100755 index 000000000..288dcd8f4 --- /dev/null +++ b/scripts/ensure_test_data.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +VERSION=$(git describe) + +if [[ -d .git ]]; then + git submodule update --init +else + if [[ ! -d ./test/data-visual ]]; then + echo "Downloading visual test data from https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz" + curl -L -s https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data-visual/ + fi + if [[ ! -d ./test/data ]]; then + echo "Downloading unit test data from https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz" + curl -L -s https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data/ + fi +fi \ No newline at end of file diff --git a/scripts/publish_release.sh b/scripts/publish_release.sh new file mode 100755 index 000000000..b881c2ad3 --- /dev/null +++ b/scripts/publish_release.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +# for normal release leave empty +# for release candidate, add "-rcN" +export MAPNIK_VERSION=$(git describe) +export TARBALL_NAME="mapnik-v${MAPNIK_VERSION}" +cd /tmp/ +rm -rf ${TARBALL_NAME} +echo "Cloning v${MAPNIK_VERSION}" +git clone --depth 1 --branch v${MAPNIK_VERSION} git@github.com:mapnik/mapnik.git ${TARBALL_NAME} +cd ${TARBALL_NAME} +git checkout "tags/v${MAPNIK_VERSION}" +echo "updating submodules" +git submodule update --depth 100 --init +rm -rf deps/mapbox/variant/.git +cd test/data/ +git remote set-url origin git@github.com:mapnik/test-data +git tag v${MAPNIK_VERSION} -a -m "tagging for v${MAPNIK_VERSION}" +git push --tags +cd ../../ +rm -rf test/data/ +cd test/data-visual/ +git remote set-url origin git@github.com:mapnik/test-data-visual +git tag v${MAPNIK_VERSION} -a -m "tagging for v${MAPNIK_VERSION}" +git push --tags +cd ../../ +rm -rf test/data-visual/ +rm -rf .git +rm -rf .gitignore +cd ../ +tar cjf ${TARBALL_NAME}.tar.bz2 ${TARBALL_NAME}/ +#aws s3 cp --acl public-read ${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v${MAPNIK_VERSION}/