From 434c0500f312ca3f86ff02a730c37003ccc3f9da Mon Sep 17 00:00:00 2001 From: MartinMikita Date: Mon, 16 Dec 2019 15:37:19 +0100 Subject: [PATCH] Removed TOOLS_VERSION, rewritten commands to use only docker-compose with TOOLS_VERSION inside .env. --- Makefile | 7 ++----- TOOLS_VERSION | 1 - qa/layer_freq.sh | 3 +-- qa/layer_numvar_analyze.sh | 3 +-- qa/layer_toplength.sh | 3 +-- quickstart.sh | 2 -- 6 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 TOOLS_VERSION diff --git a/Makefile b/Makefile index c3a7d93c..9db10774 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,6 @@ DC_OPTS?=--rm # container runs as the current user rather than root (so that created files are not root-owned) DC_USER_OPTS?=$(DC_OPTS) -u $$(id -u $${USER}):$$(id -g $${USER}) -TOOLS_VERSION?=$(shell cat TOOLS_VERSION) -export TOOLS_VERSION - .PHONY: all all: build/openmaptiles.tm2source/data.yml build/mapping.yaml build/tileset.sql @@ -182,7 +179,7 @@ etl-graph: # generate etl graph for a certain layer, e.g. etl-graph-building, etl-graph-place etl-graph-%: layers/% build/devdoc - docker run $(DC_USER_OPTS) -v $$(pwd):/tileset openmaptiles/openmaptiles-tools:${TOOLS_VERSION} generate-etlgraph layers/$*/$*.yaml ./build/devdoc + docker-compose run $(DC_USER_OPTS) openmaptiles-tools generate-etlgraph layers/$*/$*.yaml ./build/devdoc cp ./build/devdoc/etl_$*.png layers/$*/etl_diagram.png @@ -197,7 +194,7 @@ mapping-graph: @echo 'Valid layers: $(mappingLayers)' mapping-graph-%: ./layers/%/mapping.yaml build/devdoc - docker run $(DC_USER_OPTS) -v $$(pwd):/tileset openmaptiles/openmaptiles-tools:${TOOLS_VERSION} generate-mapping-graph layers/$*/$*.yaml ./build/devdoc/mapping-diagram-$* + docker-compose run $(DC_USER_OPTS) openmaptiles-tools generate-mapping-graph layers/$*/$*.yaml ./build/devdoc/mapping-diagram-$* cp ./build/devdoc/mapping-diagram-$*.png layers/$*/mapping_diagram.png # generate all etl and mapping graphs diff --git a/TOOLS_VERSION b/TOOLS_VERSION deleted file mode 100644 index fd2a0186..00000000 --- a/TOOLS_VERSION +++ /dev/null @@ -1 +0,0 @@ -3.1.0 diff --git a/qa/layer_freq.sh b/qa/layer_freq.sh index aa32074e..60c8a2c6 100755 --- a/qa/layer_freq.sh +++ b/qa/layer_freq.sh @@ -13,8 +13,7 @@ do echo " " echo "## $layerid z$z - freq" -: "${TOOLS_VERSION:=$(cat "$(dirname "$0")/../TOOLS_VERSION")}" -SQL=$(docker run --rm -v "$(pwd):/tileset" "openmaptiles/openmaptiles-tools:$TOOLS_VERSION" generate-sqlquery layers/${layerid}/${layerid}.yaml $z ) +SQL=$(docker-compose run --rm openmaptiles-tools generate-sqlquery layers/${layerid}/${layerid}.yaml $z ) SQLCODE=$(cat <<-END select $classvars , count(*) as _count_ from diff --git a/qa/layer_numvar_analyze.sh b/qa/layer_numvar_analyze.sh index 7ed5aaf6..614b4e14 100755 --- a/qa/layer_numvar_analyze.sh +++ b/qa/layer_numvar_analyze.sh @@ -13,8 +13,7 @@ do echo " " echo "## $layerid z$z - $var " -: "${TOOLS_VERSION:=$(cat "$(dirname "$0")/../TOOLS_VERSION")}" -SQL=$(docker run --rm -v "$(pwd):/tileset" "openmaptiles/openmaptiles-tools:$TOOLS_VERSION" generate-sqlquery layers/${layerid}/${layerid}.yaml $z ) +SQL=$(docker-compose run --rm openmaptiles-tools generate-sqlquery layers/${layerid}/${layerid}.yaml $z ) SQLCODE=$(cat <<-END SELECT diff --git a/qa/layer_toplength.sh b/qa/layer_toplength.sh index a4d14319..86a529eb 100755 --- a/qa/layer_toplength.sh +++ b/qa/layer_toplength.sh @@ -11,8 +11,7 @@ do echo " " echo "## $layerid z$z max length ($classvar)" -: "${TOOLS_VERSION:=$(cat "$(dirname "$0")/../TOOLS_VERSION")}" -SQL=$(docker run --rm -v "$(pwd):/tileset" "openmaptiles/openmaptiles-tools:$TOOLS_VERSION" generate-sqlquery layers/${layerid}/${layerid}.yaml $z ) +SQL=$(docker-compose run --rm openmaptiles-tools generate-sqlquery layers/${layerid}/${layerid}.yaml $z ) SQLCODE=$(cat <<-END SELECT DISTINCT $classvar , length( $classvar ) AS _length_ from diff --git a/quickstart.sh b/quickstart.sh index 1a64a72a..053e510e 100755 --- a/quickstart.sh +++ b/quickstart.sh @@ -35,8 +35,6 @@ MIN_DOCKER_VER=1.12.3 STARTTIME=$(date +%s) STARTDATE=$(date +"%Y-%m-%dT%H:%M%z") githash=$( git rev-parse HEAD ) -: "${TOOLS_VERSION:=$(cat "$(dirname "$0")/TOOLS_VERSION")}" -export TOOLS_VERSION # Options to run with docker and docker-compose - ensure the container is destroyed on exit, # as well as pass any other common parameters.