include .env SHELL = /bin/bash -o pipefail ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) 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 migrate: @docker-compose up -d @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 @docker-compose stop up: @docker-compose up stop: @docker-compose stop down: @docker-compose down -v