From d19aa5bf2463bf9e92b78dd10b66a42eae91dd01 Mon Sep 17 00:00:00 2001 From: Falke Design Date: Fri, 17 Sep 2021 18:04:40 +0200 Subject: [PATCH] Makefile: Replace static DB properties with the variables (#1222) * Replace static DB properties with the variables --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 72fcd23..9f3caff 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,12 @@ define newline endef +# use the old postgres connection values if they are existing +PGHOST := $(or $(POSTGRES_HOST),$(PGHOST)) +PGPORT := $(or $(POSTGRES_PORT),$(PGPORT)) +PGDATABASE := $(or $(POSTGRES_DB),$(PGDATABASE)) +PGUSER := $(or $(POSTGRES_USER),$(PGUSER)) +PGPASSWORD := $(or $(POSTGRES_PASSWORD),$(PGPASSWORD)) # # Determine area to work on @@ -254,7 +260,7 @@ init-dirs: build/openmaptiles.tm2source/data.yml: init-dirs ifeq (,$(wildcard build/openmaptiles.tm2source/data.yml)) - $(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools generate-tm2source $(TILESET_FILE) --host="postgres" --port=5432 --database="openmaptiles" --user="openmaptiles" --password="openmaptiles" > $@ + $(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools generate-tm2source $(TILESET_FILE) --host="$(PGHOST)" --port=$(PGPORT) --database="$(PGDATABASE)" --user="$(PGUSER)" --password="$(PGPASSWORD)" > $@ endif build/mapping.yaml: init-dirs