-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (34 loc) · 1.47 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
ACTIVATE = . .venv/bin/activate
.venv:
python3.9 -m venv .venv
virtualenv: .venv
pip: virtualenv
@$(ACTIVATE) && pip install --upgrade pip pip-tools
reqs-prod: pip
@$(ACTIVATE) && pip install --no-deps -r requirements.txt
reqs-dev: pip
@$(ACTIVATE) && pip install --no-deps -r requirements-dev.txt
install: virtualenv reqs-prod
install-dev: virtualenv reqs-dev
cd frontend && pnpm install
lint: reqs-dev
@$(ACTIVATE) && PYTHONPATH=. pylint rpi_remote_server
lock: pip
@$(ACTIVATE) && pip-compile --upgrade --generate-hashes --no-emit-index-url --output-file=requirements.txt \
--resolver=backtracking --strip-extras pyproject.toml
@$(ACTIVATE) && pip-compile --upgrade --generate-hashes --no-emit-index-url --output-file=requirements-dev.txt \
--resolver=backtracking --extra dev --strip-extras pyproject.toml
add-user:
@$(ACTIVATE) && python -m tools.add_user
generate-secret:
@$(ACTIVATE) && python -m tools.generate_secret
build-frontend:
cd frontend && pnpm build
rm -rf rpi_remote_server/templates rpi_remote_server/static
mkdir -p rpi_remote_server/templates rpi_remote_server/static
cp frontend/build/index.html rpi_remote_server/templates/index.html
cp -r frontend/build/static/* rpi_remote_server/static/.
sed -i'.bak' -e 's/\/static/\/rpi\/static/g' rpi_remote_server/templates/index.html
sed -i'.bak' -e 's/\/favicon.ico/\/rpi\/favicon.ico/g' rpi_remote_server/templates/index.html
start-dev:
@$(ACTIVATE) && EVENTLET_HUB=poll python -m rpi_remote_server.app