-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
66 lines (46 loc) · 1.52 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
ifneq (,$(wildcard ./.env))
include .env
export
endif
buildfixtures:
poetry run python manage.py buildfixtures
test: lint
DJANGO_SETTINGS_MODULE=apps.guide.settings.test poetry run python manage.py test
test-coverage:
poetry run coverage run manage.py test && poetry run coverage report
format-backend:
poetry run ruff check . --fix
poetry run black .
format-frontend:
npm run format
format: format-backend format-frontend
lint-backend:
poetry run ruff check .
poetry run black --check --diff .
lint-frontend:
npm run lint
lint: lint-backend lint-frontend
frontend:
npm ci
npm run build
backend: compilemessages
poetry install --no-root
poetry run python manage.py migrate
poetry run python manage.py createcachetable
poetry run python manage.py createsuperuser
run:
poetry run python manage.py runserver
translations: makemessages compilemessages
makemessages:
cd apps && poetry run python ../manage.py makemessages --all --no-location
cd apps && poetry run python ../manage.py makemessages --all --no-location -e ".js" -d djangojs --ignore=frontend/static/*
compilemessages:
cd apps && poetry run python ../manage.py compilemessages
docker-build:
docker build -t guide:latest --build-arg POETRY_INSTALL_ARGS="" -f Dockerfile .
docker-run:
docker run --name guide_latest -p ${PORT}:${PORT} --env-file .env guide:latest sh -c 'poetry run python manage.py runserver 0.0.0.0:${PORT}'
docker-exec:
docker exec -it guide_latest /bin/bash
docker-init:
docker exec -it guide_latest /bin/bash -c "make backend"