diff --git a/tools/deploy_aio.sh b/tools/deploy_aio.sh index 535116544cc925cf91fc0c93a27651ae41f91cc5..915a54576554b4c4b24e76d7a0b5237fac49c5d3 100755 --- a/tools/deploy_aio.sh +++ b/tools/deploy_aio.sh @@ -49,13 +49,25 @@ function check_failure { docker images docker ps -a - failed_containers=$(docker ps -a --format "{{.Names}}" --filter status=exited) + # All docker container's status are created, restarting, running, removing, + # paused, exited and dead. Containers without running status are treated as + # failure. removing is added in docker 1.13, just ignore it now. + failed_containers=$(docker ps -a --format "{{.Names}}" \ + --filter status=created \ + --filter status=restarting \ + --filter status=paused \ + --filter status=exited \ + --filter status=dead) for failed in ${failed_containers}; do docker logs --tail all ${failed} done copy_logs + + if [[ -n "$failed_containers" ]]; then + exit 1; + fi } function write_configs {