-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (46 loc) · 1.44 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
APP_DIR=meownotes
APP_ENTRY_POINT=__init__.py
MEOWNOTES_PORT=8000
MEOWNOTES_HOST=0.0.0.0
VENV_DIR=venv
install:
echo ">>> INFO: setting up MeowNotes environment"
python3 -m venv $(VENV_DIR) && \
source $(VENV_DIR)/bin/activate && \
pip install flask && \
pip install python-dateutil && \
pip install uwsgi && \
pip install pytest && \
pip install pylint
fresh-db:
echo ">>> INFO: (re)creating MeowNotes database"
. $(VENV_DIR)/bin/activate && \
export FLASK_APP=$(APP_DIR) && \
flask initdb
run-debug:
echo ">>> INFO: starting MeowNotes with debug mode enabled on default port 5000"
source $(VENV_DIR)/bin/activate && \
export MEOWNOTES_DEBUG=True && \
python $(APP_DIR)/$(APP_ENTRY_POINT)
run-prod:
echo ">>> INFO: starting MeowNotes with prod mode enabled on $(MEOWNOTES_HOST):$(MEOWNOTES_PORT)/"
source $(VENV_DIR)/bin/activate && \
export FLASK_APP=$(APP_DIR) && \
export FLASK_RUN_HOST=$(MEOWNOTES_HOST) && \
export FLASK_RUN_PORT=$(MEOWNOTES_PORT) && \
flask run
run-wsgi:
echo ">>> INFO: starting MeowNotes using uWSGI on $(MEOWNOTES_HOST):$(MEOWNOTES_PORT)/"
source $(VENV_DIR)/bin/activate && \
export MEOWNOTES_LOCALDEV=True && \
uwsgi --socket $(MEOWNOTES_HOST):$(MEOWNOTES_PORT) --protocol=http -w wsgi:application
see-routes:
source $(VENV_DIR)/bin/activate && \
export FLASK_APP=$(APP_DIR) && \
flask routes
test:
source $(VENV_DIR)/bin/activate && \
pytest
lint:
source $(VENV_DIR)/bin/activate && \
pylint $(APP_DIR)