Exit with error code 1 when there is failure container in gate
Change-Id: If832e5535b0788dfcfe38cd6cf88f0e0001bacd5 Closes-Bug: #1668001
This commit is contained in:
parent
ef34e2a1c5
commit
6e41c1e326
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user