forked from makerspace/makeradmin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (57 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
78 lines (57 loc) · 1.6 KB
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
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
build-dev: .env
$(DEV_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_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))
init-npm:
npm ci
cd admin && npm ci
cd public && npm ci
init-pip:
python3 -m pip install --upgrade -r requirements.txt
python3 -m 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 build
$(COMPOSE) run api python3 ./firstrun.py
firstrun-dev: init build-dev
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