-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (55 loc) · 1.93 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
.PHONY: init
SHELL := /bin/bash
SERVICE_NAME=virtual-lab-manager
define HELPTEXT
Usage: make COMMAND
commands for managing the project
Commands:
dev Run development api server.
init Run project (keycloak and postgres) containers
kill Kill project (keycloak and postgres) containers
build Build docker image
format Check formatting of files and fixes any formatting issues
format-check Only check formatting of files but do not modify them to fix formatting issues
lint Fix linting issues in files, if any
lint-check Check linting issues in files but do not modify them to fix linting issues
style-check Run formatting, and linting
type-check Run static type checks
test Run tests
init-db Create & seed db tables
check-db-schema Checks if db schema change requires a migration. Note: Not all changes can be checked here.
endef
export HELPTEXT
help:
@echo "$$HELPTEXT"
dev:
poetry run uvicorn virtual_labs.api:app --reload
dev-p:
@poetry run dotenv -f .env.local set STRIPE_WEBHOOK_SECRET $$(poetry run dotenv -f env-prep/stripe-data/.env.local get STRIPE_WEBHOOK_SECRET) > /dev/null
poetry run uvicorn virtual_labs.api:app --reload
init:
./dev-init.sh $(filter-out $@,$(MAKECMDGOALS))
kill-amd:
docker compose -f ./env-prep/docker-compose-dev-amd.yml -p vlm-project down --remove-orphans --volumes
kill:
docker compose -f ./env-prep/docker-compose-dev.yml -p vlm-project down --remove-orphans --volumes
build:
docker build -t $(SERVICE_NAME) . --platform=linux/amd64
format:
poetry run ruff format
format-check:
poetry run ruff format --check
lint:
poetry run ruff check --fix
lint-check:
poetry run ruff check
style-check:
poetry run pre-commit run --all-files --config ./.pre-commit-config-ci.yaml
type-check:
poetry run mypy . --strict
test:
poetry run pytest
init-db:
poetry run alembic upgrade head
check-db-schema:
poetry run alembic check