2023-11-15 11:29:29 +03:00
|
|
|
include .env
|
2023-10-24 15:46:25 +03:00
|
|
|
SHELL = /bin/bash -o pipefail
|
|
|
|
|
|
|
|
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
2023-11-15 11:29:29 +03:00
|
|
|
MIGRATIONS_DIR=$(ROOT_DIR)/files/migrations
|
|
|
|
|
|
|
|
all: migrator migrate up
|
|
|
|
|
|
|
|
migrator:
|
|
|
|
@docker buildx build --tag neur0toxine/clickhouse-migrations:latest -f $(ROOT_DIR)/files/Dockerfile.migrator $(ROOT_DIR)/files
|
2023-10-24 15:46:25 +03:00
|
|
|
|
|
|
|
migrate:
|
|
|
|
@docker-compose up -d
|
2023-11-15 11:29:29 +03:00
|
|
|
@docker run -v $(MIGRATIONS_DIR):/migrations --network host neur0toxine/clickhouse-migrations:latest migrate --host=http://localhost:$(CLICKHOUSE_PORT) --user=$(CLICKHOUSE_USER) --password=$(CLICKHOUSE_PASSWORD) --db=default --migrations-home=/migrations
|
2023-10-24 15:46:25 +03:00
|
|
|
@docker-compose stop
|
|
|
|
|
|
|
|
up:
|
|
|
|
@docker-compose up
|
2023-11-15 11:29:29 +03:00
|
|
|
|
|
|
|
stop:
|
|
|
|
@docker-compose stop
|
|
|
|
|
|
|
|
down:
|
|
|
|
@docker-compose down -v
|