-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 993 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (26 loc) · 993 Bytes
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
.PHONY: help dev test scan ui docker docker-scan clean
VENV ?= .venv
PY := $(VENV)/bin/python
DIR ?= tests/fixtures/vulnerable-repo
OUT ?= cryptonex-out
help:
@grep -E '^[a-z-]+:.*?##' $(MAKEFILE_LIST) | sed 's/:.*##/\t/'
dev: ## create venv and install (editable, with dev extras)
python3 -m venv $(VENV)
$(VENV)/bin/pip install -q -U pip
$(VENV)/bin/pip install -q -e ".[dev]"
test: ## run the test suite
$(PY) -m pytest -q
scan: ## scan $(DIR) -> $(OUT)
$(VENV)/bin/cryptonex scan $(DIR) --out $(OUT)
ui: ## open the local console on the last scan
$(VENV)/bin/cryptonex serve --result $(OUT)/result.json
docker: ## build the image
docker build -t cryptonex:local .
docker-scan: ## run a scan inside the container ( DIR=path/to/your/repo )
mkdir -p "$(OUT)"
docker run --rm --user "$$(id -u):$$(id -g)" \
-v "$(abspath $(DIR))":/scan:ro -v "$(abspath $(OUT))":/out \
cryptonex:local scan /scan --out /out
clean:
rm -rf $(OUT) dist build *.egg-info .pytest_cache