From 0ad5ca7b12f186a5c6def66f2ed1bb22c7364118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darien=20Hern=C3=A1ndez=20Gonz=C3=A1lez?= Date: Tue, 26 Nov 2024 09:51:02 +0100 Subject: [PATCH] Fix start-deps ## Bug I encountered the error "docker-compose command not found" when running `test-integration`. ## Solution Github actions use `docker compose` instead of `docker-compose`. ## Fix Fix both Makefile target `start-deps` and `stop-deps` to check whether the command `docker-compose` (run locally) exists or `docker-compose` (run github actions) exists, and use it to spin up the containes --- makefiles/test-integration.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefiles/test-integration.mk b/makefiles/test-integration.mk index 430b02f..1e680a5 100644 --- a/makefiles/test-integration.mk +++ b/makefiles/test-integration.mk @@ -13,10 +13,10 @@ test-integration: ## Start dependencies for integration tests or local dev via docker-compose up start-deps: - @test ! -f $(INTEGRATION_DOCKER_COMPOSE) || docker-compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) up -d + test ! -f $(INTEGRATION_DOCKER_COMPOSE) || (command -v docker-compose >/dev/null 2>&1 && docker-compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) up -d || docker compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) up -d) ## Stop dependencies for integration tests or local dev via docker-compose down stop-deps: - @test ! -f $(INTEGRATION_DOCKER_COMPOSE) || docker-compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) down + @test ! -f $(INTEGRATION_DOCKER_COMPOSE) || (command -v docker-compose >/dev/null 2>&1 && docker-compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) down || docker compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) down) .PHONY: test-integration start-deps stop-deps