diff --git a/Makefile b/Makefile index 75e41d1..af67ab7 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,15 @@ +define deploy_dependencies + @-docker create --name ${db} \ + -e POSTGRES_PASSWORD=password \ + -p 5433:5432 \ + postgres + docker start ${db} +endef + +define run_migrations + cargo run --bin tests-migrate +endef + default: frontend ## Debug build cargo build @@ -19,6 +31,20 @@ dev-env: ## Download development dependencies cargo fetch yarn install + +env.db.recreate: ## Deploy dependencies + @-docker rm -f ${db} + $(call deploy_dependencies) + sleep 5 + $(call run_migrations) + +env.db: ## Deploy dependencies + $(call deploy_dependencies) + sleep 5 + $(call run_migrations) + + + doc: ## Prepare documentation cargo doc --no-deps --workspace --all-features @@ -43,7 +69,7 @@ lint: ## Lint codebase yarn lint migrate: ## Run database migrations - cargo run --bin tests-migrate + $(call run_migrations) release: frontend ## Release build cargo build --release