fix: conitnue fixing makefile
This commit is contained in:
parent
dfd2d39d7d
commit
cfab8ca04d
31
Makefile
31
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user