This repository has been archived by the owner on Sep 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (62 loc) · 1.88 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.PHONY: all help build logs loc up stop down
include .env
export
ts := $(shell /bin/date "+%Y-%m-%d--%H-%M-%S")
# make all - Default Target. Does nothing.
all:
@echo "Helper commands."
@echo "For more information try 'make help'."
# target: help - Display callable targets.
help:
@egrep "^# target:" [Mm]akefile
# target: env = copy env vars to your .env file
env:
cp ./etc/env.dist ./.env
# target: attach = attach to target container
attach:
docker attach --sig-proxy=false pca-api
# target: build = build all containers
build:
docker compose build --no-cache
# target: app logs - Runs docker logs in the terminal
logs:
docker logs pca-api
# target: up - Run local web server.
up:
docker compose up -d
# target: stop - Stop all docker containers
stop:
docker compose stop
# target: down - Remove all docker containers
down:
docker compose down
# target: restart - stop and restart api container
restart:
docker restart pca-api
docker attach --sig-proxy=false pca-api
# target: shell - docker python shell within container
shell:
docker exec -it pca-api python3
# target: bash - bash into docker container
bash:
docker exec -it pca-api bash
# target: build_emails: build mjml emails - requires: npm install -g mjml
build_emails:
mjml src/api/templates/emails/mjml/* -o src/api/templates/emails/
# target: dummy - load test data
dummy:
docker exec -it pca-api flask load-test-data
# target: dummy_reporting initalizes dummy reporting subscriptions
dummy_reporting:
docker exec -it pca-api python scripts/create_dummy_reporting_data.py
# target: coverage - runs pytests against code and generates coverage html
coverage:
coverage run --omit *.venv*,*test* -m pytest ./tests/ --disable-warnings
coverage html
# target: cc - calculates cyclomatic complexity
cc:
radon cc ./src/ -e "*.venv*" -s -o SCORE
# target: lint = lint all files
lint:
pre-commit autoupdate
pre-commit run --all-files