-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 loc) · 1.2 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
venv ?= venv
activate_script = $(venv)/bin/activate
tracker_root_dir := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
flask_app := $(tracker_root_dir)tracker.app
reload_patterns := \
$(tracker_root_dir)instance/notes-v2.db \
$(tracker_root_dir)instance/notes-v2.db-wal \
$(tracker_root_dir)Makefile
reload_files := $(subst $(eval ) ,:,$(reload_patterns))
.DEFAULT_GOAL := serve
.PHONY: serve-uvicorn
serve-uvicorn:
source $(activate_script) \
&& uvicorn tracker.app_prod:asgi_app \
--port 7529 \
--reload
.PHONY: serve-hypercorn
serve-hypercorn:
source $(activate_script) \
&& hypercorn tracker.app_prod:app \
--bind 127.0.0.1:7529 \
--workers 4 \
--reload
.PHONY: serve
serve:
source $(activate_script) \
&& flask --app $(flask_app) run \
--debug --port 7529 --with-threads \
--extra-files $(reload_files)
# ---------------------------------------------------------------------
.PHONY: install
install: $(activate_script)
source $(activate_script) \
&& pip install --upgrade pip \
&& pip install --requirement requirements.txt
%/bin/activate:
-brew install pyenv
-pyenv install 3.11.3
pyenv local 3.11.3 \
&& eval "`pyenv init -`" \
&& python -m venv $*