From cfab8ca04d68bedcc79218d036fb0bd92af987e8 Mon Sep 17 00:00:00 2001 From: Nemo D'ACREMONT Date: Mon, 2 Dec 2024 16:09:00 +0100 Subject: [PATCH] fix: conitnue fixing makefile --- Makefile | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index f19a6c3..b3f2a12 100644 --- a/Makefile +++ b/Makefile @@ -1,33 +1,30 @@ -DIR_SQL = PostgreSQL -DIR_BACK = back-end -DOCKER_COMPOSE = docker compose +DIR_SQL=PostgreSQL +DIR_BACK=back-end +DOCKER_COMPOSE=docker compose all: build build: dev -dev: $(DIR_BACK)/.env - set -o allexport # Required to source correctly .env with old docker-compose - (. $(DIR_BACK)/.env && $(DOCKER_COMPOSE) -f docker-compose.dev.yml up) || true - +o allexport +dev: ${DIR_BACK}/.env + cd ${DIR_SQL} && make && cd - + (. ${DIR_BACK}/.env && ${DOCKER_COMPOSE} -f docker-compose.dev.yml up) || true prod: - set -o allexport # Required to source correctly .env with old docker-compose - (. $(DIR_BACK)/.env.production && $(DOCKER_COMPOSE) -f docker-compose.prod.yml up) || true - +o allexport + cd ${DIR_SQL} && make && cd - + (. ${DIR_BACK}/.env.production && ${DOCKER_COMPOSE} -f docker-compose.prod.yml up) || true -$(DIR_BACK)/.env: $(DIR_BACK)/.env.example - cp $(DIR_BACK)/.env.example $(DIR_BACK)/.env - cd $(DIR_SQL) && make +$(DIR_BACK)/.env: ${DIR_BACK}/.env.example + cp ${DIR_BACK}/.env.example ${DIR_BACK}/.env clean: - ${RM} $(DIR_BACK)/.env + ${RM} ${DIR_BACK}/.env # Delete the db volume sudo ${RM} -r dev-db || true - cd $(DIR_SQL) && make clean - $(DOCKER_COMPOSE) -f docker-compose.dev.yml down --rmi local -v --remove-orphans || true + cd ${DIR_SQL} && make clean + ${DOCKER_COMPOSE} -f docker-compose.dev.yml down --rmi local -v --remove-orphans || true clean_prod: clean - $(DOCKER_COMPOSE) -f docker-compose.prod.yml down --rmi local -v --remove-orphans || true + ${DOCKER_COMPOSE} -f docker-compose.prod.yml down --rmi local -v --remove-orphans || true .PHONY: clean all prepare_dev build clean_prod