mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-03-04 02:23:09 +08:00
Fix: Use docker compose
instead of docker-compose
, if available.
This commit is contained in:
parent
11cc00c942
commit
33a5edce05
3 changed files with 21 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
#!/bin/sh
|
||||
cd $(dirname $0)
|
||||
docker-compose up
|
||||
|
||||
DOCKER_COMPOSE="docker-compose"
|
||||
if docker --help | grep -q -F 'compose*'; then
|
||||
DOCKER_COMPOSE="docker compose"
|
||||
fi
|
||||
|
||||
$DOCKER_COMPOSE up
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue