-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (52 loc) · 1.61 KB
/
Makefile
File metadata and controls
70 lines (52 loc) · 1.61 KB
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
.PHONY: launch
launch:
KHR_DEBUG=1 poetry run fastapi dev kharon/app.py --host 0.0.0.0
.PHONY: lint
lint: check-mypy-error-count
poetry run flake8 kharon service
.PHONY: test
test: lint
poetry run pytest tests --cov=kharon
.PHONY: format
format:
poetry run black kharon service
.PHONY: mypy
mypy:
poetry run mypy --implicit-reexport --show-error-codes kharon service
.PHONY: check-mypy-error-count
check-mypy-error-count: MYPY_INFO = $(shell expr `poetry run mypy kharon | grep ": error" | wc -l`)
check-mypy-error-count: MYPY_ERROR_COUNT = 0
check-mypy-error-count:
@if [ ${MYPY_INFO} -gt ${MYPY_ERROR_COUNT} ]; then \
echo mypy error count $(MYPY_INFO) is more than $(MYPY_ERROR_COUNT); \
false; \
fi
SRC_FOLDER ?= ./kharon ./service
REPORT_FOLDER ?= ./reports
./reports/security/bandit/:
@mkdir -p ./reports/security/bandit/
.PHONY: bandit
bandit: ./reports/security/bandit/ ## SECURITY - Run bandit
poetry run bandit ${SRC_FOLDER}/* -r -x "*.pyi,*/_generated/*,*__pycache__*" -v -ll -f json > ${REPORT_FOLDER}/security/bandit/index.json
.PHONY: build
build: build_fe build_be build_service
.PHONY: build_be
build_be:
docker build -t dref360/kharon-backend:latest .
.PHONY: build_fe
build_fe:
docker build -t dref360/kharon-frontend:latest webapp
.PHONY: build_service
build_service:
docker build -t dref360/kharon-service:latest service
.PHONY: push
push: push_fe push_be push_service
.PHONY: build_be
push_be:
docker push dref360/kharon-backend:latest
.PHONY: build_fe
push_fe:
docker push dref360/kharon-frontend:latest
.PHONY: build_service
push_service:
docker push dref360/kharon-service:latest