This repository has been archived by the owner on May 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
57 lines (43 loc) · 1.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort -k 1,1 | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: start
start: ## Start the development server
@docker-compose up -d --build
.PHONY: stop
stop: ## Stop the development server
@docker-compose stop
.PHONY: lint
lint: ## Lint the project
@docker-compose run --rm backend sh -c "ruff format --check . && ruff check . --output-format=full"
.PHONY: format-code
format-code: ## Format the backend code
@docker-compose run --rm backend sh -c "ruff format . && ruff check . --fix"
.PHONY: test
test: ## Test the project
@docker-compose run --rm backend sh -c "ruff format . && ruff check . --fix && pytest --no-cov-on-fail --cov"
.PHONY: bash
bash: ## Shell into the backend
@docker-compose exec backend bash
.PHONY: dbshell
dbshell: ## Start a psql shell
@docker-compose exec db psql -Utimed timed
.PHONY: shell_plus
shell_plus: ## Run shell_plus
@docker-compose exec backend ./manage.py shell_plus
.PHONY: makemigrations
makemigrations: ## Make django migrations
@docker-compose exec backend ./manage.py makemigrations
.PHONY: migrate
migrate: ## Migrate django
@docker-compose exec backend ./manage.py migrate
.PHONY: debug-backend
debug-backend: ## Start backend container with service ports for debugging
@docker-compose run --use-aliases --service-ports backend
.PHONY: flush
flush: ## Flush database contents
@docker-compose exec backend ./manage.py flush --no-input
.PHONY: loaddata
loaddata: flush ## Loads test data into the database
@docker-compose exec backend ./manage.py loaddata timed/fixtures/test_data.json