-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
60 lines (37 loc) · 1.33 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
SHELL=/bin/bash
PROJECT_NAME=my_project_name
DOCKER_RUN=docker compose run --rm app
main: run
init:
@sed -i -e 's/\r$$//' ./setup/set-new-django-project.bash
@./setup/set-new-django-project.bash
run:
docker compose up --build --remove-orphans
check:
${DOCKER_RUN} "python3 manage.py check --deploy \
--settings ${PROJECT_NAME}.settings.docker_production \
--fail-level ERROR \
&& echo 'production settings looks good'"
# ${DOCKER_RUN} "mkdir -p ./media/backup"
# ${DOCKER_RUN} "cp ./db.sqlite3 ./media/backup/db_$$(date +'%Y-%m-%d_%H-%M-%S').sqlite3"
# make test args=my_app
tests: check
${DOCKER_RUN} "python3 manage.py test ${args};"
# make new app=my_app
new:
${DOCKER_RUN} "python3 manage.py startapp ${app};"
user:
${DOCKER_RUN} "python3 manage.py createsuperuser;"
tra:
${DOCKER_RUN} "if [ ! -d ./locale ]; then mkdir locale; fi;"
${DOCKER_RUN} "python3 manage.py makemessages -l ar"
${DOCKER_RUN} "python3 manage.py compilemessages"
migrations:
${DOCKER_RUN} "python3 manage.py makemigrations --dry-run"
${DOCKER_RUN} "python3 manage.py makemigrations"
- ${DOCKER_RUN} "python3 manage.py generateschema --file ./templates/api/openapi-schema.yaml"
# make data-migrations app=my_app
data-migrations:
${DOCKER_RUN} "python3 manage.py makemigrations --empty ${app}"
shell:
${DOCKER_RUN} "python3 manage.py shell"