diff --git a/.github/check-service.sh b/.github/check-service.sh index c226805b..39e0d83c 100755 --- a/.github/check-service.sh +++ b/.github/check-service.sh @@ -4,10 +4,12 @@ __service=$1 __containerID=$(docker-compose ps -q "${__service}") -__restart_count=$(docker inspect --format '{{ .RestartCount }}' "$__containerID") -__running=$(docker inspect --format '{{ .State.Running }}' "$__containerID") +__initial_restart_count=$(docker inspect --format '{{ .RestartCount }}' "$__containerID") +__is_running=$(docker inspect --format '{{ .State.Running }}' "$__containerID") +sleep 10 +__final_restart_count=$(docker inspect --format '{{ .RestartCount }}' "$__containerID") -if [ "$__running" != "true" ] || [ "$__restart_count" -gt 0 ]; then +if [ "$__is_running" != "true" ] || [ "$__final_restart_count" -gt "$__initial_restart_count" ]; then echo "$__service is either not running or continuously restarting" docker-compose ps "${__service}" docker-compose logs "${__service}"