forked from vas3k/vas3k.club
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (64 loc) · 2.02 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
# Set the default goal if no targets were specified on the command line
.DEFAULT_GOAL = run
# Makes shell non-interactive and exit on any error
.SHELLFLAGS = -ec
PROJECT_NAME=vas3k_club
run-dev: ## Runs dev server
pipenv run python manage.py runserver 0.0.0.0:8000
run-queue: ## Runs task broker
pipenv run python manage.py qcluster
docker-run-queue:
python3 manage.py qcluster
run-bot: ## Runs telegram bot
pipenv run python bot/main.py
docker-run-bot:
python3 bot/main.py
docker-run-helpdeskbot:
python3 helpdeskbot/main.py
docker-run-cron:
env >> /etc/environment
cron -f -l 2
run-uvicorn: ## Runs uvicorn (ASGI) server in managed mode
pipenv run uvicorn --fd 0 --lifespan off club.asgi:application
docker-run-dev: ## Runs dev server in docker
python3 ./utils/wait_for_postgres.py
python3 manage.py migrate
python3 manage.py update_tags
python3 manage.py runserver 0.0.0.0:8000
docker-run-production: docker-migrate docker-update-achievements
cp -r /app/frontend/static /tmp/
gunicorn club.asgi:application -w 7 -k uvicorn.workers.UvicornWorker --bind=0.0.0.0:8814 --capture-output --log-level debug --access-logfile - --error-logfile -
docker-update-achievements:
python3 manage.py update_achievements
help: ## Display this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[0;32m%-30s\033[0m %s\n", $$1, $$2}'
lint: ## Lint code with flake8
@pipenv run flake8 $(PROJECT_NAME)
migrate: ## Migrate database to the latest version
pipenv run python3 manage.py migrate
docker-migrate:
python3 manage.py migrate
build-frontend: ## Runs webpack
npm run --prefix frontend build
test:
pipenv run python3 manage.py test
test-ci: ## Run tests (intended for CI usage)
python3 manage.py test
psql:
psql -h localhost -p 5433 -d vas3k_club -U vas3k
.PHONY: \
docker-run-dev \
docker-run-production \
run-dev \
run-queue \
run-bot \
docker-run-bot \
run-uvicorn \
requirements \
help \
lint \
migrate \
build-frontend \
test-ci