forked from threat9/routersploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (36 loc) · 1.04 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
.PHONY: build run test lint lint-modules clean prune help
MODULES=routersploit
RSF_IMAGE=routersploit
FLAKE8_IGNORED_RULES=E501,W503
build:
docker build -t $(RSF_IMAGE) .
run:
docker run -it --rm $(RSF_IMAGE)
lint:
flake8 --exclude=__init__.py --ignore=$(FLAKE8_IGNORED_RULES) tests $(MODULES)
tests: clean
ifeq ($(MODULES), routersploit)
python -m unittest discover
else
python -m unittest $(MODULES)
endif
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
prune:
docker images -q -f dangling=true | xargs docker rmi
docker ps -q -f status=exited | xargs docker rm
help:
@echo " run"
@echo " Run Routersploit in docker container"
@echo " lint"
@echo " Check style with flake8."
@echo " lint-modules"
@echo " Check modules style with flake8."
@echo " test"
@echo " Run test suite"
@echo " clean"
@echo " Remove python artifacts."
@echo " prune"
@echo " Remove dangling docker images and exited containers."