-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
105 lines (80 loc) · 2.56 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
.PHONY: build
build:
# We are not building with Docker compose on purpose, so we can have just one image (and probably save disk space)
docker build . -t thenewboston-backend:current --no-cache
.PHONY: update-docker-compose-yaml
update-docker-compose-yaml:
cp docker-compose.yml ~/
.PHONY: docker-compose-down
docker-compose-down:
cd; docker compose down
.PHONY: run-production
run-production: # purposefully do not depend on `build` target
cd; docker compose up -d --no-build --force-recreate
.PHONY: run-development
run-development: build
# docker-compose.yml is inherited and overridden by docker-compose.dev.yml
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --force-recreate
.PHONY: deploy
deploy: build docker-compose-down update-docker-compose-yaml run-production;
.PHONY: deploy-cleanup
deploy-cleanup:
docker image prune -f
docker builder prune -f
.PHONY: install
install:
poetry install
.PHONY: install-pre-commit
install-pre-commit:
poetry run pre-commit uninstall; poetry run pre-commit install
.PHONY: lint
lint:
poetry run pre-commit run --all-files
.PHONY: migrate
migrate:
poetry run python -m thenewboston.manage migrate
.PHONY: migrations
migrations:
poetry run python -m thenewboston.manage makemigrations
.PHONY: run-celery
run-celery:
poetry run celery -A thenewboston.project worker -l INFO
.PHONY: run-celery-beat
run-celery-beat:
poetry run celery -A thenewboston.project beat -l INFO
.PHONY: run-dependencies
run-dependencies:
# docker-compose.yml is inherited and overridden by docker-compose.dev.yml
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --force-recreate db redis
.PHONY: run-server
run-server:
poetry run python -m thenewboston.manage runserver
.PHONY: run-daphne
run-daphne:
poetry run python -m thenewboston.manage collectstatic --no-input
poetry run daphne thenewboston.project.asgi:application -p 8000 -b 127.0.0.1
.PHONY: run-discord-bot
run-discord-bot:
poetry run python -m thenewboston.discord.bot
.PHONY: shell
shell:
poetry run python -m thenewboston.manage shell
.PHONY: dbshell
dbshell:
poetry run python -m thenewboston.manage dbshell
.PHONY: superuser
superuser:
poetry run python -m thenewboston.manage createsuperuser
.PHONY: test
test:
poetry run pytest -v -rs --show-capture=no
.PHONY: test-detailed
test-detailed:
poetry run pytest -vv -rs -s
.PHONY: test-cov
test-cov:
poetry run pytest -vv -rs --show-capture=no --cov=thenewboston --cov-report=html:./tmp/coverage
.PHONY: lint-and-test
lint-and-test: lint test ;
.PHONY: update
update: install migrate install-pre-commit ;