Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: Update Makefile to dynamically select Docker Compose command … #207

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deployment/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ PROJECT_NAME = tyr
# Default environment file
ENV_FILE = .env.development

# Docker Compose command with default environment file
DC = docker-compose --env-file $(ENV_FILE)
# Determine the Docker Compose command based on the Docker version
export DC := $(shell command -v docker >/dev/null && docker --version | awk '{print $$3}' | cut -d'.' -f1,2 | sed 's/,//g' | (read v; if [ $$(echo "$$v >= 20.10" | bc -l) -eq 1 ]; then echo "docker compose --env-file $(ENV_FILE)"; else echo "docker-compose --env-file $(ENV_FILE)"; command -v docker-compose >/dev/null || { echo "Error: Docker Compose is not installed." >&2; exit 1; }; fi))

# Required environment variables
REQUIRED_ENV_VARS = DB_NAME DB_USER DB_PASSWORD GADM_FILE POSTGIS_VERSION
Expand Down
Loading