Parcourir la source

Adjust "retry.sh" to bail if our container does

Tianon Gravi il y a 10 ans
Parent
commit
865bca45f9
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      test/retry.sh

+ 5 - 0
test/retry.sh

@@ -32,6 +32,11 @@ while ! eval "$@" &> /dev/null; do
 		eval "$@" # to hopefully get a useful error message
 		eval "$@" # to hopefully get a useful error message
 		false
 		false
 	fi
 	fi
+	if [ "$cid" ] && [ "$(docker inspect -f '{{.State.Running}}' "$cid" 2>/dev/null)" != 'true' ]; then
+		echo >&2 "${image:-the container} stopped unexpectedly!"
+		( set -x && docker logs "$cid" ) >&2 || true
+		false
+	fi
 	echo >&2 -n .
 	echo >&2 -n .
 	sleep "$sleep"
 	sleep "$sleep"
 done
 done