2023-05-15 15:00:20 +02:00
|
|
|
include .env
|
|
|
|
export $(shell sed 's/=.*//' .env)
|
|
|
|
|
2023-05-10 09:02:59 +02:00
|
|
|
SHELL := /bin/sh
|
2023-09-16 15:15:05 +02:00
|
|
|
PROJECTNAME ?= agenda_culturel
|
2023-05-15 15:00:20 +02:00
|
|
|
APP_NAME := $(PROJECTNAME)
|
2023-05-10 09:02:59 +02:00
|
|
|
BACKEND_APP_NAME := $(APP_NAME)-backend
|
|
|
|
|
|
|
|
define HELP
|
|
|
|
|
|
|
|
Manage $(PROJECTNAME). Usage:
|
|
|
|
|
|
|
|
make lint Run linter
|
|
|
|
make format Run formatter
|
|
|
|
make test Run tests
|
|
|
|
make super-user Create super user
|
|
|
|
make make-migrations Make migrations
|
|
|
|
make migrate Migrate
|
2023-05-10 21:48:56 +02:00
|
|
|
make build-dev Build and run dev environment
|
|
|
|
make stop-dev Stop dev environment
|
|
|
|
make stop-prod Stop prod environment
|
|
|
|
make build-prod Build and run prod environment
|
2024-08-17 11:51:32 +02:00
|
|
|
make restar-prod Restart prod environment
|
2023-05-10 09:02:59 +02:00
|
|
|
make all Show help
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
export HELP
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo "$$HELP"
|
|
|
|
|
|
|
|
lint:
|
|
|
|
@bash ./scripts/lint.sh
|
|
|
|
|
|
|
|
format:
|
|
|
|
@bash ./scripts/format.sh
|
|
|
|
|
|
|
|
test:
|
|
|
|
@bash ./scripts/test.sh
|
|
|
|
|
|
|
|
super-user:
|
|
|
|
docker exec -it $(BACKEND_APP_NAME) sh "-c" \
|
|
|
|
"python manage.py createsuperuser"
|
|
|
|
|
|
|
|
make-migrations:
|
|
|
|
docker exec -it $(BACKEND_APP_NAME) $(SHELL) "-c" \
|
|
|
|
"python manage.py makemigrations"
|
|
|
|
|
|
|
|
migrate:
|
|
|
|
docker exec -it $(BACKEND_APP_NAME) $(SHELL) "-c" \
|
|
|
|
"python manage.py migrate"
|
|
|
|
|
2023-11-15 16:29:33 +01:00
|
|
|
create-categories:
|
|
|
|
docker exec -it $(BACKEND_APP_NAME) $(SHELL) "-c" \
|
|
|
|
"python3 manage.py runscript create_categories"
|
|
|
|
|
2024-10-16 23:55:03 +02:00
|
|
|
create-reference-locations:
|
|
|
|
docker exec -it $(BACKEND_APP_NAME) $(SHELL) "-c" \
|
|
|
|
"python3 manage.py runscript create_reference_locations"
|
|
|
|
|
2023-05-10 21:48:56 +02:00
|
|
|
build-dev:
|
2023-05-15 15:00:20 +02:00
|
|
|
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml up --build -d
|
2023-05-10 21:48:56 +02:00
|
|
|
|
2023-10-18 11:53:07 +02:00
|
|
|
build-dev-log:
|
|
|
|
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.yml up --build
|
|
|
|
|
2023-05-10 21:48:56 +02:00
|
|
|
build-prod:
|
2023-05-15 15:00:20 +02:00
|
|
|
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.prod.yml up --build -d
|
2023-05-10 21:48:56 +02:00
|
|
|
|
2023-11-15 12:01:35 +01:00
|
|
|
build-prod-log:
|
|
|
|
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.prod.yml up --build
|
|
|
|
|
2023-05-10 21:48:56 +02:00
|
|
|
stop-dev:
|
|
|
|
@docker-compose -f docker-compose.yml down
|
|
|
|
|
|
|
|
stop-prod:
|
|
|
|
@docker-compose -f docker-compose.prod.yml down
|
|
|
|
|
2023-11-23 23:13:48 +01:00
|
|
|
restart-backend-prod:
|
|
|
|
docker-compose -f docker-compose.prod.yml restart backend
|
|
|
|
|
2024-08-17 11:51:32 +02:00
|
|
|
prod-restart:
|
|
|
|
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.prod.yml restart
|
|
|
|
|
2023-05-10 09:02:59 +02:00
|
|
|
all: help
|
|
|
|
|
2023-05-10 21:48:56 +02:00
|
|
|
.PHONY: help lint format test super-user make-migrations migrate build-dev build-prod stop-dev stop-prod all
|