3
3
# Test/Dev
4
4
DEV_CMD =cd intbot && DJANGO_ENV="dev" uv run --env-file .env -- ./manage.py
5
5
TEST_CMD =cd intbot && DJANGO_SETTINGS_MODULE="intbot.settings" DJANGO_ENV="test" uv run pytest --nomigrations
6
+ UV_RUN_DEV =cd intbot && DJANGO_ENV="dev" uv run
6
7
7
8
# Docker
8
9
DOCKER_RUN_WITH_PORT =docker run -p 4672:4672 --add-host=host.internal:host-gateway -e DJANGO_ENV="local_container" -it intbot:$(V )
20
21
# First target is dummy so we you won't run anything by accident
21
22
@echo " Hello world!, Please check the file content for details"
22
23
24
+
25
+
26
+ # Local development
27
+ # =================
28
+
23
29
server :
24
30
$(DEV_CMD ) runserver 0.0.0.0:4672
25
31
@@ -32,18 +38,40 @@ migrate:
32
38
migrations :
33
39
$(DEV_CMD ) makemigrations -n $(N )
34
40
41
+ bot :
42
+ $(DEV_CMD ) run_bot
43
+
44
+
45
+ # Test, lint, etc
46
+ # ================
47
+
35
48
test :
36
49
$(TEST_CMD ) -s -vv
37
50
38
- bot :
39
- $(DEV_CMD ) run_bot
51
+
52
+ lint :
53
+ # '.' because UV_RUN_DEV implies cd to intbot/
54
+ $(UV_RUN_DEV ) ruff check .
55
+
56
+ lint/fix :
57
+ # '.' because UV_RUN_DEV implies cd to intbot/
58
+ $(UV_RUN_DEV ) ruff check --fix .
59
+
60
+ format :
61
+ # '.' because UV_RUN_DEV implies cd to intbot/
62
+ $(UV_RUN_DEV ) ruff format .
63
+
64
+ type-check :
65
+ $(UV_RUN_DEV ) mypy intbot/
66
+
40
67
41
68
42
69
client/send_test_webhook :
43
70
uv run client/send_test_webhook.py
44
71
45
72
46
73
# Targets to be run inside the container (for build/prod/deployments)
74
+ # ===================================================================
47
75
48
76
in-container/collectstatic :
49
77
DJANGO_ENV=" build" python intbot/manage.py collectstatic --noinput
@@ -60,6 +88,7 @@ in-container/migrate:
60
88
61
89
62
90
# Docker management targets
91
+ # =========================
63
92
64
93
docker/build :
65
94
docker build . -t intbot:$(current_git_hash )
@@ -69,7 +98,8 @@ docker/run/gunicorn:
69
98
70
99
71
100
# Deploymenet targets
72
- #
101
+ # ====================
102
+
73
103
deploy/provision :
74
104
$(DEPLOY_CMD ) playbooks/01_setup.yml
75
105
$(DEPLOY_CMD ) playbooks/02_nginx.yml
0 commit comments