From e078adc93b9ba52d85a21adb61c16c2e25e367c9 Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 2 Dec 2015 11:26:13 -0800 Subject: [PATCH] Windows: No subshell due to bash 3.x Signed-off-by: John Howard --- hack/make/.ensure-frozen-images | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hack/make/.ensure-frozen-images b/hack/make/.ensure-frozen-images index 74286bda47..56509a511b 100644 --- a/hack/make/.ensure-frozen-images +++ b/hack/make/.ensure-frozen-images @@ -36,7 +36,10 @@ esac if ! docker inspect "${images[@]}" &> /dev/null; then hardCodedDir='/docker-frozen-images' if [ -d "$hardCodedDir" ]; then - ( set -x; tar -cC "$hardCodedDir" . | docker load ) + # Do not use a subshell for the following command. Windows CI + # runs bash 3.x so will not trap an error in a subshell. + # http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells + set -x; tar -cC "$hardCodedDir" . | docker load; set +x else dir="$DEST/frozen-images" # extract the exact "RUN download-frozen-image-v2.sh" line from the Dockerfile itself for consistency @@ -58,7 +61,10 @@ if ! docker inspect "${images[@]}" &> /dev/null; then } } ' ${DOCKER_FILE:="Dockerfile"} | sh -x - ( set -x; tar -cC "$dir" . | docker load ) + # Do not use a subshell for the following command. Windows CI + # runs bash 3.x so will not trap an error in a subshell. + # http://stackoverflow.com/questions/22630363/how-does-set-e-work-with-subshells + set -x; tar -cC "$dir" . | docker load; set +x fi fi