-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathMakefile
37 lines (27 loc) · 950 Bytes
/
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
repo_root = $(shell git rev-parse --show-toplevel)
include $(repo_root)/tools/makefiles/python.mk
-include ./.env
DBTYPE ?= sqlite
ifeq ($(DBTYPE), postgresql)
WORKBENCH__DB__URL ?= postgresql:///workbench
else
WORKBENCH__DB__URL ?= sqlite:///.data/workbench.db
endif
.PHONY: start
start:
WORKBENCH__DB__URL="$(WORKBENCH__DB__URL)" uv run start-service
.PHONY: alembic-upgrade-head
alembic-upgrade-head:
WORKBENCH__DB__URL="$(WORKBENCH__DB__URL)" uv run alembic upgrade head
.PHONY: alembic-generate-migration
alembic-generate-migration:
ifndef migration
$(info You must provide a name for the migration.)
$(info ex: make alembic-generate-migration migration="neato changes")
$(error "migration" is not set)
else
WORKBENCH__DB__URL="$(WORKBENCH__DB__URL)" uv run alembic revision --autogenerate -m "$(migration)"
endif
DOCKER_PATH = $(repo_root)
docker-%: DOCKER_IMAGE_NAME := workbench
include $(repo_root)/tools/makefiles/docker.mk