-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·88 lines (55 loc) · 1.49 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
PYTHON=python3
# All targets are PHONY
.PHONY: all $(MAKECMDGOALS)
# Formatting and typecheck
format:
@${PYTHON} -m black avmon/ tests/
format-check:
@${PYTHON} -m black --check avmon/ tests/
type-check:
@${PYTHON} -m mypy avmon/ tests/
check: format-check type-check
# Tests
test:
@${PYTHON} -m pytest
testx:
@${PYTHON} -m pytest -x
testxs:
@${PYTHON} -m pytest -x -s
# Git hooks
pre-commit: check
pre-push: pre-commit test
install-git-hooks:
@printf "make pre-commit" > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit
@printf "make pre-push" > .git/hooks/pre-push && chmod +x .git/hooks/pre-push
@echo "git hooks installed"
# Dependencies
install-deps:
@${PYTHON} -m pip install --user -r requirements.txt
install-deps-dev: install-deps
@${PYTHON} -m pip install --user -r requirements-dev.txt
# Setup
create-dotenv:
@[ -f .env ] || printf "POSTGRES_PASSWORD=$$(pwgen 32 1)\n" > .env
dev-setup: install-deps-dev install-git-hooks create-dotenv
# Running locally
run-collector:
@${PYTHON} -m avmon.collector
run-backend:
@${PYTHON} -m avmon.backend
run-both:
@${PYTHON} -m avmon.both
run-frontend:
@${PYTHON} -m avmon.frontend
run-all:
@${PYTHON} -m avmon.all
# Running in Docker
docker-up:
@docker-compose up --build -d
docker-dbs:
@docker-compose -f docker-compose-dbs.yml up --build -d
docker-down:
@docker-compose down -v || docker-compose kill
# Documentation
dot:
@for file in docs/*.dot; do dot -Tsvg "$$file" > "docs/$$(basename "$$file" .dot).svg"; done