Skip to content

Commit 0ad5ca7

Browse files
authored
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
1 parent 0a4a927 commit 0ad5ca7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

makefiles/test-integration.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ test-integration:
1313

1414
## Start dependencies for integration tests or local dev via docker-compose up
1515
start-deps:
16-
@test ! -f $(INTEGRATION_DOCKER_COMPOSE) || docker-compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) up -d
16+
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)
1717

1818
## Stop dependencies for integration tests or local dev via docker-compose down
1919
stop-deps:
20-
@test ! -f $(INTEGRATION_DOCKER_COMPOSE) || docker-compose -p "$(shell basename $$PWD)" -f $(INTEGRATION_DOCKER_COMPOSE) down
20+
@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)
2121

2222
.PHONY: test-integration start-deps stop-deps

0 commit comments

Comments
 (0)