From 58d08ea4bc877107c51447bb57f1c078a8af4bb6 Mon Sep 17 00:00:00 2001 From: Wesley B <62723358+wesleyboar@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:02:34 -0500 Subject: [PATCH] fix: WP-602 `docker compose` with and without dash (#301) --- demdata_cms/Makefile | 9 +++++---- ecep_cms/Makefile | 9 +++++---- example_cms/Makefile | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/demdata_cms/Makefile b/demdata_cms/Makefile index b4b1daaa..095a7d38 100644 --- a/demdata_cms/Makefile +++ b/demdata_cms/Makefile @@ -2,13 +2,14 @@ DOCKERHUB_REPO := $(shell cat ./docker_repo.var) DOCKER_TAG ?= $(shell git rev-parse --short HEAD) DOCKER_IMAGE := $(DOCKERHUB_REPO):$(DOCKER_TAG) DOCKER_IMAGE_LATEST := $(DOCKERHUB_REPO):latest +DOCKER_COMPOSE_CMD := $(shell if command -v docker-compose > /dev/null; then echo "docker-compose"; else echo "docker compose"; fi) # `DOCKER_IMAGE_BRANCH` tag is the git tag for the commit if it exists, else the branch on which the commit exists DOCKER_IMAGE_BRANCH := $(DOCKERHUB_REPO):$(shell git describe --exact-match --tags 2> /dev/null || git symbolic-ref --short HEAD) #.PHONY: build build: - docker-compose -f docker-compose.dev.yml build + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml build .PHONY: build-full build-full: @@ -27,12 +28,12 @@ publish-latest: .PHONY: start start: - docker-compose -f docker-compose.dev.yml up + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml up .PHONY: stop stop: - docker-compose -f docker-compose.dev.yml down + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml down .PHONY: stop-full stop-v: - docker-compose -f docker-compose.dev.yml down -v + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml down -v diff --git a/ecep_cms/Makefile b/ecep_cms/Makefile index b4b1daaa..095a7d38 100644 --- a/ecep_cms/Makefile +++ b/ecep_cms/Makefile @@ -2,13 +2,14 @@ DOCKERHUB_REPO := $(shell cat ./docker_repo.var) DOCKER_TAG ?= $(shell git rev-parse --short HEAD) DOCKER_IMAGE := $(DOCKERHUB_REPO):$(DOCKER_TAG) DOCKER_IMAGE_LATEST := $(DOCKERHUB_REPO):latest +DOCKER_COMPOSE_CMD := $(shell if command -v docker-compose > /dev/null; then echo "docker-compose"; else echo "docker compose"; fi) # `DOCKER_IMAGE_BRANCH` tag is the git tag for the commit if it exists, else the branch on which the commit exists DOCKER_IMAGE_BRANCH := $(DOCKERHUB_REPO):$(shell git describe --exact-match --tags 2> /dev/null || git symbolic-ref --short HEAD) #.PHONY: build build: - docker-compose -f docker-compose.dev.yml build + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml build .PHONY: build-full build-full: @@ -27,12 +28,12 @@ publish-latest: .PHONY: start start: - docker-compose -f docker-compose.dev.yml up + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml up .PHONY: stop stop: - docker-compose -f docker-compose.dev.yml down + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml down .PHONY: stop-full stop-v: - docker-compose -f docker-compose.dev.yml down -v + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml down -v diff --git a/example_cms/Makefile b/example_cms/Makefile index b4b1daaa..095a7d38 100644 --- a/example_cms/Makefile +++ b/example_cms/Makefile @@ -2,13 +2,14 @@ DOCKERHUB_REPO := $(shell cat ./docker_repo.var) DOCKER_TAG ?= $(shell git rev-parse --short HEAD) DOCKER_IMAGE := $(DOCKERHUB_REPO):$(DOCKER_TAG) DOCKER_IMAGE_LATEST := $(DOCKERHUB_REPO):latest +DOCKER_COMPOSE_CMD := $(shell if command -v docker-compose > /dev/null; then echo "docker-compose"; else echo "docker compose"; fi) # `DOCKER_IMAGE_BRANCH` tag is the git tag for the commit if it exists, else the branch on which the commit exists DOCKER_IMAGE_BRANCH := $(DOCKERHUB_REPO):$(shell git describe --exact-match --tags 2> /dev/null || git symbolic-ref --short HEAD) #.PHONY: build build: - docker-compose -f docker-compose.dev.yml build + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml build .PHONY: build-full build-full: @@ -27,12 +28,12 @@ publish-latest: .PHONY: start start: - docker-compose -f docker-compose.dev.yml up + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml up .PHONY: stop stop: - docker-compose -f docker-compose.dev.yml down + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml down .PHONY: stop-full stop-v: - docker-compose -f docker-compose.dev.yml down -v + $(DOCKER_COMPOSE_CMD) -f docker-compose.dev.yml down -v