From 69430a3e60eb45fda6ba140573a3eb1a121531aa Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sat, 24 Feb 2024 15:54:30 +0100 Subject: [PATCH] Add DB dump tasks --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 3fb92bbe..b3b6fee8 100644 --- a/Makefile +++ b/Makefile @@ -46,3 +46,8 @@ launch-production: launch-production-app: $(BLOOM_PRODUCTION_DOCKER) --name bloom-production-app --rm d4g/bloom:${VERSION} /venv/bin/python3 app.py +dump-dev-db: + $(BLOOM_DEV_DOCKER) --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' + +dump-db: + @docker run --mount type=bind,source="$(shell pwd)",target=/source_code --env-file ./.env.test --network=bloom_net --rm postgres:latest sh -c 'export PGPASSWORD=$$POSTGRES_PASSWORD && pg_dump -Fc $$POSTGRES_DB -h $$POSTGRES_HOSTNAME -p $$POSTGRES_PORT -U $$POSTGRES_USER> /source_code/bloom_$(shell date +%Y%m%d_%H%M).dump' \ No newline at end of file