fixes for auto-release script

This commit is contained in:
Dane Springmeyer 2016-09-06 00:20:48 -07:00
parent 4cc0706940
commit 48316d47b0
2 changed files with 22 additions and 11 deletions

View file

@ -8,12 +8,14 @@ VERSION=$(git describe)
if [[ -d .git ]]; then if [[ -d .git ]]; then
git submodule update --init git submodule update --init
else 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 if [[ ! -d ./test/data ]]; then
echo "Downloading unit test data from https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz" echo "Downloading unit test data from https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz"
mkdir -p test/data/
curl -L -s https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data/ curl -L -s https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data/
fi fi
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/
curl -L -s https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data-visual/
fi
fi fi

View file

@ -6,30 +6,39 @@ set -o pipefail
# for normal release leave empty # for normal release leave empty
# for release candidate, add "-rcN" # for release candidate, add "-rcN"
export MAPNIK_VERSION=$(git describe) export MAPNIK_VERSION=$(git describe)
export TARBALL_NAME="mapnik-v${MAPNIK_VERSION}" export TARBALL_NAME="mapnik-${MAPNIK_VERSION}"
cd /tmp/ cd /tmp/
rm -rf ${TARBALL_NAME} rm -rf ${TARBALL_NAME}
echo "Cloning v${MAPNIK_VERSION}" echo "Cloning ${MAPNIK_VERSION}"
git clone --depth 1 --branch v${MAPNIK_VERSION} git@github.com:mapnik/mapnik.git ${TARBALL_NAME} git clone --depth 1 --branch ${MAPNIK_VERSION} git@github.com:mapnik/mapnik.git ${TARBALL_NAME}
cd ${TARBALL_NAME} cd ${TARBALL_NAME}
git checkout "tags/v${MAPNIK_VERSION}" git checkout "tags/${MAPNIK_VERSION}"
echo "updating submodules" echo "updating submodules"
# TODO: skip initializing submodule if data is already tagged
# Will require bundling variant as well
git submodule update --depth 100 --init git submodule update --depth 100 --init
rm -rf deps/mapbox/variant/.git rm -rf deps/mapbox/variant/.git
cd test/data/ cd test/data/
git remote set-url origin git@github.com:mapnik/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}" echo "tagging test data"
git tag ${MAPNIK_VERSION} -a -m "tagging for ${MAPNIK_VERSION}"
git push --tags git push --tags
cd ../../ cd ../../
echo "removing test data submodule"
rm -rf test/data/ rm -rf test/data/
cd test/data-visual/ cd test/data-visual/
git remote set-url origin git@github.com:mapnik/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}" echo "tagging visual data"
git tag ${MAPNIK_VERSION} -a -m "tagging for ${MAPNIK_VERSION}"
git push --tags git push --tags
cd ../../ cd ../../
echo "removing visual test data submodule"
rm -rf test/data-visual/ rm -rf test/data-visual/
rm -rf .git rm -rf .git
rm -rf .gitignore rm -rf .gitignore
cd ../ cd ../
echo "creating tarball of ${TARBALL_NAME}.tar.bz2"
tar cjf ${TARBALL_NAME}.tar.bz2 ${TARBALL_NAME}/ tar cjf ${TARBALL_NAME}.tar.bz2 ${TARBALL_NAME}/
#aws s3 cp --acl public-read ${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v${MAPNIK_VERSION}/ echo "uploading $(dirname ${TARBALL_NAME})/${TARBALL_NAME}.tar.bz2 to s3://mapnik/dist/${MAPNIK_VERSION}/"
# TODO: upload to github releases instead of s3
aws s3 cp --acl public-read ${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/${MAPNIK_VERSION}/