Skip to content
Snippets Groups Projects
Commit b7c070a6 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Exit with error code 1 when there is failure container in gate"

parents 504a0d71 6e41c1e3
No related branches found
No related tags found
No related merge requests found
...@@ -49,13 +49,25 @@ function check_failure { ...@@ -49,13 +49,25 @@ function check_failure {
docker images docker images
docker ps -a 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 for failed in ${failed_containers}; do
docker logs --tail all ${failed} docker logs --tail all ${failed}
done done
copy_logs copy_logs
if [[ -n "$failed_containers" ]]; then
exit 1;
fi
} }
function write_configs { function write_configs {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment