-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
88 lines (74 loc) · 1.8 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
SHELL := /bin/bash
.PHONY: setup
setup:
stat venv/bin/activate &> /dev/null || \
virtualenv venv -p python3.6
source venv/bin/activate; \
pip install -r requirements.txt
.PHONY: setup_test
setup_test:
source venv/bin/activate; \
pip install -r requirements.txt; \
pip install -r requirements_test.txt
cd server/functions; \
npm install
.PHONY: setup_ci
setup_ci:
pip install -r requirements.txt
pip install -r requirements_test.txt
cd server/functions; \
npm install
.PHONY: install
install:
sudo sed "s|{{DIR}}|$(dirname $(realpath dingdongditch.service))|g" \
dingdongditch.service \
> /lib/systemd/system/dingdongditch.service
sudo chmod 644 /lib/systemd/system/dingdongditch.service
sudo systemctl daemon-reload
sudo systemctl enable dingdongditch.service
sudo systemctl start dingdongditch
sudo systemctl status dingdongditch
.PHONY: uninstall
uninstall:
sudo systemctl stop dingdongditch
sudo systemctl disable dingdongditch.service
sudo rm /lib/systemd/system/dingdongditch.service
sudo systemctl daemon-reload
.PHONY: upgrade
upgrade:
git checkout master
git pull
sudo systemctl restart dingdongditch
sudo systemctl status dingdongditch
.PHONY: run
run:
source venv/bin/activate; \
source env.sh; \
python run.py
.PHONY: shell
shell:
source venv/bin/activate; \
source env.sh; \
python
.PHONY: test_client
test_client:
source venv/bin/activate; \
PYTHONPATH=.:./tests/mocks py.test tests
.PHONY: lint_client
lint_client:
source venv/bin/activate; \
flake8 dingdongditch
.PHONY: test_server
test_server:
cd server/functions; \
npm test
.PHONY: test
test: test_server test_client
.PHONY: test_ci
test_ci: test_server
PYTHONPATH=.:./tests/mocks py.test --cov=dingdongditch --cov-branch tests
.PHONY: lint_ci
lint_ci:
flake8 dingdongditch
cd server/functions; \
npm run lint