-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
114 lines (75 loc) · 1.94 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# # Makefile
# # Set the default target
# .DEFAULT_GOAL := runserver
# # Define the virtual environment name
# VENV := venv
# # Install project dependencies
# install:
# poetry install
# # Create a virtual environment
# venv:
# poetry env use python3.9
# poetry install
# # Run Django development server
# runserver:
# poetry run python backend/manage.py runserver
# # Run Django migrations
# migrate:
# poetry run python backend/manage.py migrate
# # Create a new Django migration
# makemigrations:
# poetry run python manage.py makemigrations
# # Run Django tests
# test:
# poetry run python manage.py test
# # Clean up generated files
# clean:
# rm -rf $(VENV)
# find . -name "*.pyc" -delete
# target:
# recipie
#doing this lets makesystem know they aren't files but cmnds and speeds up the process,avoids conflicts if there are files with the same name
.PHONY: install rs mm mi ms csu shell t i-pre-commit u-pre-commit up-pre-commit
#installing pre-commit
i-pre-commit:
poetry run pre-commit install
#uninstalling pre-commit
u-pre-commit:
poetry run pre-commit uninstall
#updating pre-commit
up-pre-commit: u-pre-commit i-pre-commit
# run pre-commit outside of the git hooks
pre-commit:
poetry run pre-commit run --all-files
#installing dependencies
-i:
poetry install
#runserver:
rs:
poetry run python backend/manage.py runserver
#makemigrations:
mm:
poetry run python backend/manage.py makemigrations
#migrate:
mi:
poetry run python backend/manage.py migrate
#makemigrations and migrate:
ms: mm mi;
#create superuser:
csu:
poetry run python backend/manage.py createsuperuser
#django shell:
shell:
poetry run python backend/manage.py shell
#test:
t:
poetry run pytest
#dumpdata:
dd:
cd backend && poetry run python manage.py dumpdata > whole.json
#loaddata:
ld:
cd backend && poetry run python manage.py loaddata whole.json
# docker compose
docker-c-up:
docker-compose -f docker-compose.dev.yml up --force-recreate db