@@ -9,10 +9,14 @@ MAKEFLAGS += --no-print-directory
99# User-configurable variables (edit this)
1010# INFRA_SERVICES: long-running infra (db, broker, cache, ...)
1111# INFRA_INIT_SERVICES: one-shot services that prepare INFRA_SERVICES
12+ # MIGRATION_DB_SERVICE: transactional db service used by alembic (empty = no migrations)
13+ # STAIRWAY_TEST: path to stairway test (empty = skip stairway step)
1214# -----------------------------
1315PROJECT_NAME ?= $(notdir $(abspath .) )
1416INFRA_SERVICES ?= db_pg
1517INFRA_INIT_SERVICES ?=
18+ MIGRATION_DB_SERVICE ?= db_pg
19+ STAIRWAY_TEST ?= tests/integration/with_infra/test_stairway.py
1620
1721# -----------------------------
1822# Internal vars / aliases
@@ -24,6 +28,7 @@ DOCKER_ENV := scripts/makefile/docker_env.sh
2428LOCAL_ENV := scripts/makefile/local_env.sh
2529DOCKER_PRUNE := scripts/makefile/docker_prune.sh
2630PYCACHE_DEL := scripts/makefile/pycache_del.sh
31+ MIGRATION := scripts/makefile/migration.sh
2732DISHKA_PLOT_DATA := scripts/dishka/plot_dependencies_data.py
2833
2934# Test stack is isolated by project name
@@ -108,6 +113,14 @@ down:
108113stop-all :
109114 docker ps -q | xargs -r docker stop
110115
116+ # Migrations
117+ .PHONY : migration
118+ migration : local-env
119+ PROJECT_NAME=$(PROJECT_NAME ) \
120+ MIGRATION_DB_SERVICE=$(MIGRATION_DB_SERVICE ) \
121+ STAIRWAY_TEST=$(STAIRWAY_TEST ) \
122+ $(MIGRATION ) " $( msg) "
123+
111124# Tests (with infra)
112125.PHONY : test-docker
113126test-docker : docker-env
0 commit comments