2016-11-11 16:28:37 +00:00
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
2016-11-15 19:41:07 +00:00
DOCKER_EXEC = docker
DC_EXEC = docker-compose
2016-11-11 16:28:37 +00:00
#Check installed versions
2016-11-15 19:41:07 +00:00
echo "This requires a docker engine version 1.10.0+ and docker-compose 1.6.0+. If not, it is expected to fail. See https://docs.docker.com/engine/installation/ and https://docs.docker.com/compose/install/"
$DOCKER_EXEC --version
$DC_EXEC --version
2016-11-11 16:28:37 +00:00
#Remove
2016-11-15 19:41:07 +00:00
$DC_EXEC down
$DC_EXEC rm -fv
2016-11-11 16:28:37 +00:00
echo "Remove old volume"
2016-11-15 19:41:07 +00:00
$DOCKER_EXEC volume ls -q | grep openmaptiles | xargs -r docker volume rm || true
2016-11-11 16:28:37 +00:00
echo "Make directories "
mkdir -p build
mkdir -p data
testdata = zurich_switzerland.osm.pbf
if [ ! -f ./data/${ testdata } ] ; then
echo " Download $testdata "
rm -f ./data/*
wget https://s3.amazonaws.com/metro-extracts.mapzen.com/zurich_switzerland.osm.pbf -P ./data
fi
2016-11-15 19:41:07 +00:00
$DOCKER_EXEC run --rm -v $( pwd ) :/tileset openmaptiles/openmaptiles-tools make
$DC_EXEC up -d postgres
2016-11-11 16:28:37 +00:00
sleep 30
2016-11-15 19:41:07 +00:00
$DC_EXEC run --rm import-water
$DC_EXEC run --rm import-natural-earth
$DC_EXEC run --rm import-lakelines
$DC_EXEC run --rm import-osm
$DC_EXEC run --rm import-sql
2016-11-11 16:28:37 +00:00
2016-11-15 19:41:07 +00:00
$DC_EXEC -f docker-compose.yml -f docker-compose-test-override.yml run --rm generate-vectortiles
2016-11-11 16:28:37 +00:00
2016-11-15 19:41:07 +00:00
$DC_EXEC stop postgres
2016-11-11 16:28:37 +00:00
echo " The vectortiles created from $testdata "
ls ./data/*.mbtiles -la
echo "Hello ... start experimenting - see docs ! "