-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (24 loc) · 748 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (24 loc) · 748 Bytes
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
.PHONY: setup start stop run test install
# Generate a .env with a strong SECRET_KEY (won't overwrite an existing one).
setup:
@if [ -f .env ]; then \
echo ".env already exists — leaving it untouched."; \
else \
echo "SECRET_KEY=$$(python3 -c 'import secrets; print(secrets.token_hex(32))')" > .env; \
echo "FLASK_DEBUG=0" >> .env; \
echo ".env created. Review it, then run: make start"; \
fi
# Production-like run via Docker.
start:
docker compose up -d
stop:
docker compose down
# Local dev server.
run:
FLASK_DEBUG=1 python3 app.py
# Install runtime + dev dependencies.
install:
pip install -r requirements.txt -r requirements-dev.txt
# Run the test suite.
test:
FLASK_DEBUG=1 DATABASE_URL="sqlite:///:memory:" pytest -q