-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (25 loc) · 957 Bytes
/
Makefile
File metadata and controls
30 lines (25 loc) · 957 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
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: _requirements.el _native_deps
@$(DOCKER) build --build-arg NATIVE_DEPS="$$(cat _native_deps)" --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 check . --extend-select=ISC001
ruff format --check .