-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
53 lines (39 loc) · 1.28 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
.PHONY: default \
lint reformat type-check security-check \
start stop rebuild destroy \
migrate create-admin \
routes migrations
default:
@echo "Call a specific subcommand:"
@echo
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null\
| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}'\
| sort\
| egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
@echo
@exit 1
start:
docker-compose up --build --detach
rebuild: start
stop:
docker-compose down
destroy:
docker-compose down --volumes
migrations:
docker-compose exec cabotage-app python3 -m flask db revision --autogenerate -m "$(filter-out $@,$(MAKECMDGOALS))"
migrate:
docker-compose exec cabotage-app python3 -m flask db upgrade
create-admin:
docker-compose exec cabotage-app python3 -m cabotage.scripts.create_admin
routes:
docker-compose exec cabotage-app python3 -m flask routes
requirements/%.txt: requirements/%.in
docker compose run --build --rm base pip-compile --generate-hashes --output-file=$@ $(F) $<
reformat:
docker compose run --build --rm base black .
lint:
docker compose run --build --rm base bin/lint
security-check:
docker compose run --build --rm base bandit -c pyproject.toml -r .
type-check:
docker compose run --build --rm base mypy --config-file pyproject.toml .