-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (28 loc) · 978 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
30
31
32
NAME:="tr-05-template"
PORT:="9090"
all: test build
black:
black code/ -l 79 -t py39 --skip-magic-trailing-comma --exclude=payloads_for_tests.py
build: stop
docker scout cves alpine:3.14;
docker build -q -t $(NAME) .;
docker run -dp $(PORT):$(PORT) --name $(NAME) $(NAME)
flake: black
flake8 code/
test: flake
cd code; coverage run --source api/ -m pytest --verbose tests/ && coverage report; cd -
test_lf:
cd code; coverage run --source api/ -m pytest --verbose -vv --lf tests/ && coverage report; cd -
stop:
docker stop $(NAME); docker rm $(NAME); true
# --------------------------------------------------------------------- #
# If ngrok can be used by you then you can run below make commands
# --------------------------------------------------------------------- #
up: down build expose
down: unexpose stop
expose:
ngrok http $(PORT) > /dev/null &
echo_ngrok:
curl -s localhost:4040/api/tunnels | jq -r ".tunnels[0].public_url"
unexpose:
pkill ngrok || true