forked from jvanderaa/NetStats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (44 loc) · 1.34 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
IMG_NAME=jvanderaa/netstats
IMG_VERSION=0.0.1
.DEFAULT_GOAL := test
.PHONY: build
build:
docker build -t $(IMG_NAME):$(IMG_VERSION) .
.PHONY: cli
cli:
docker run -it \
-v $(shell pwd):/local \
$(IMG_NAME):$(IMG_VERSION) bash
.PHONY: run_attached
run_attached:
docker run -it \
-v $(shell pwd)/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
-p 9273:9273 \
$(IMG_NAME):$(IMG_VERSION)
.PHONY: run
run:
docker run -itd \
-v $(shell pwd)/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
-p 9273:9273 \
$(IMG_NAME):$(IMG_VERSION)
.PHONY: test
test: lint unit
.PHONY: lint
lint:
@echo "Starting lint"
docker run -v $(shell pwd):/local $(IMG_NAME):$(IMG_VERSION) sort --check requirements.txt
docker run -v $(shell pwd):/local $(IMG_NAME):$(IMG_VERSION) black --check .
docker run -v $(shell pwd):/local $(IMG_NAME):$(IMG_VERSION) make pylint
docker run -v $(shell pwd):/local $(IMG_NAME):$(IMG_VERSION) bandit --recursive --config .bandit.yml .
docker run -v $(shell pwd):/local $(IMG_NAME):$(IMG_VERSION) yamllint --strict .
@echo "Completed lint"
.PHONY: unit
unit:
@echo "Starting unit tests"
docker run -v $(shell pwd):/local $(IMG_NAME):$(IMG_VERSION) pytest -vv
@echo "Completed unit tests"
.PHONY: cli
# Using to pass arguments to pylint that would fail in docker run command
.PHONY: pylint
pylint:
find ./ -name "*.py" | xargs pylint