Skip to content
Snippets Groups Projects
Commit 6e41c1e3 authored by Jeffrey Zhang's avatar Jeffrey Zhang
Browse files

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

Change-Id: If832e5535b0788dfcfe38cd6cf88f0e0001bacd5
Closes-Bug: #1668001
parent ef34e2a1
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
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