-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
79 lines (59 loc) · 1.86 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
COMPOSE=docker compose
TEST_COMPOSE=docker compose -p test -f docker-compose.yml -f docker-compose.test.yml
DEV_COMPOSE=docker compose -f docker-compose.yml -f docker-compose.dev.yml
PYTEST_PARAMS?=
-include local.mk
build: .env
$(COMPOSE) build
run: .env
$(COMPOSE) up
dev: .env
$(DEV_COMPOSE) up --build
test-clean: .env
$(TEST_COMPOSE) down -v --remove-orphans || true
test: .env test-clean
$(TEST_COMPOSE) build
$(TEST_COMPOSE) up --abort-on-container-exit --exit-code-from test
clean-nuke:
echo "Removing all databases"
$(COMPOSE) down
docker volume rm -f makeradmin_dbdata
docker volume rm -f makeradmin_logs
docker volume rm -f makeradmin_accessy_syncer_logs
docker volume rm -f makeradmin_email_dispatcher_logs
docker volume rm -f makeradmin_node_modules
docker volume rm -f test_dbdata
docker volume rm -f test_logs
dev-test:
(cd api/src && python3 -m pytest --workers auto -ra $(PYTEST_PARAMS))
dev-docs:
docker build -f ./docs/Dockerfile ./docs -t makeradmin-docs:latest && docker run -p "8000:8000" -v "$(shell pwd)/docs:/work/docs" makeradmin-docs:latest serve -f /work/docs/mkdocs.yml -a 0.0.0.0:8000
init-npm:
npm ci
cd admin && npm ci
cd public && npm ci
init-pip:
python3 -m pip install --upgrade -r requirements.txt
init-pre-commit:
pre-commit install --install-hooks
init: init-pip init-npm
.env:
python3 create_env.py
stop:
$(COMPOSE) down
test-admin-js:
npm --prefix admin run eslint
npm --prefix admin run test
firstrun: .env init build
$(COMPOSE) run api python3 ./firstrun.py
format: format-python format-precommit format-webstuff
format-python:
ruff format .
ruff check --fix
format-webstuff:
npx prettier --write --cache .
format-precommit:
pre-commit run
.PHONY: build firstrun init init-npm init-pip install run stop dev-test
.PHONY: test-clean test dev format format-python format-webstuff
.PHONY: format-precommit .env