-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
29 lines (24 loc) · 843 Bytes
/
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
IMAGE_NAME = melpazoid
DOCKER ?= docker
DOCKER_OPTIONS = --cap-drop all --security-opt=no-new-privileges --pids-limit=50
DOCKER_OUTPUT ?= --progress=plain # e.g. '--progress=plain' xor '--quiet'
.PHONY: run
run:
python3 melpazoid/melpazoid.py
# https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html
.PHONY: test
test: image
@$(DOCKER) run --rm --network=none ${DOCKER_OPTIONS} ${IMAGE_NAME}
.PHONY: term
term: image
$(DOCKER) run -it --rm --entrypoint=/bin/bash ${DOCKER_OPTIONS} ${IMAGE_NAME}
.PHONY: image
image:
@$(DOCKER) build --build-arg PACKAGE_MAIN ${DOCKER_OUTPUT} \
--tag ${IMAGE_NAME} -f docker/Dockerfile .
.PHONY: test-melpazoid
test-melpazoid:
rm -rf _requirements.el
mypy --strict --non-interactive --install-types melpazoid
pytest --doctest-modules --durations=5
ruff format --check .