diff --git a/integration-tests.sh b/integration-tests.sh index 0ded841..d7b180a 100755 --- a/integration-tests.sh +++ b/integration-tests.sh @@ -11,6 +11,11 @@ if command -v gfind > /dev/null 2>&1; then FIND="$(which gfind)" fi +DOCKER_COMPOSE="docker-compose" +if docker --help | grep -q -F 'compose*'; then + DOCKER_COMPOSE="docker compose" +fi + run_test() { local exit_code echo @@ -20,10 +25,10 @@ run_test() { ( cd "$1" set +e - docker-compose up --build --abort-on-container-exit --exit-code-from tests + $DOCKER_COMPOSE up --build --abort-on-container-exit --exit-code-from tests exit_code="$?" - docker-compose down -v + $DOCKER_COMPOSE down -v if [[ "$exit_code" != 0 ]]; then exit "$exit_code" fi diff --git a/sample/docker-compose/start.sh b/sample/docker-compose/start.sh index 91af7ea..11d3754 100755 --- a/sample/docker-compose/start.sh +++ b/sample/docker-compose/start.sh @@ -1,3 +1,9 @@ #!/bin/sh cd $(dirname $0) -docker-compose up \ No newline at end of file + +DOCKER_COMPOSE="docker-compose" +if docker --help | grep -q -F 'compose*'; then + DOCKER_COMPOSE="docker compose" +fi + +$DOCKER_COMPOSE up \ No newline at end of file diff --git a/unit-tests.sh b/unit-tests.sh index d3e1eb7..6bd3902 100755 --- a/unit-tests.sh +++ b/unit-tests.sh @@ -1,3 +1,9 @@ #!/bin/sh cd unit-tests -docker-compose up --build --abort-on-container-exit --exit-code-from tests + +DOCKER_COMPOSE="docker-compose" +if docker --help | grep -q -F 'compose*'; then + DOCKER_COMPOSE="docker compose" +fi + +$DOCKER_COMPOSE up --build --abort-on-container-exit --exit-code-from tests