mirror of
https://github.com/bokysan/docker-postfix.git
synced 2024-09-20 06:46:10 +08:00
Fix: Use docker compose
instead of docker-compose
, if available.
This commit is contained in:
parent
11cc00c942
commit
33a5edce05
|
@ -11,6 +11,11 @@ if command -v gfind > /dev/null 2>&1; then
|
||||||
FIND="$(which gfind)"
|
FIND="$(which gfind)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
DOCKER_COMPOSE="docker-compose"
|
||||||
|
if docker --help | grep -q -F 'compose*'; then
|
||||||
|
DOCKER_COMPOSE="docker compose"
|
||||||
|
fi
|
||||||
|
|
||||||
run_test() {
|
run_test() {
|
||||||
local exit_code
|
local exit_code
|
||||||
echo
|
echo
|
||||||
|
@ -20,10 +25,10 @@ run_test() {
|
||||||
(
|
(
|
||||||
cd "$1"
|
cd "$1"
|
||||||
set +e
|
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="$?"
|
exit_code="$?"
|
||||||
|
|
||||||
docker-compose down -v
|
$DOCKER_COMPOSE down -v
|
||||||
if [[ "$exit_code" != 0 ]]; then
|
if [[ "$exit_code" != 0 ]]; then
|
||||||
exit "$exit_code"
|
exit "$exit_code"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd $(dirname $0)
|
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
|
#!/bin/sh
|
||||||
cd unit-tests
|
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