Skip to content

Commit e62deb1

Browse files
committed
The suite has to fail in case second build failed as well.
We do not want to continue Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent a7a03eb commit e62deb1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ function docker_build_with_version {
150150
BUILD_OPTIONS+=" --squash"
151151
fi
152152
i=1
153+
build_failed=1
153154
while [ $i -le 2 ]; do
154155
command="docker build ${BUILD_OPTIONS} -f $dockerfile ${DOCKER_BUILD_CONTEXT}"
155156
echo "-> building using $command"
@@ -185,11 +186,16 @@ function docker_build_with_version {
185186
fi
186187
echo "$IMAGE_ID" > .image-id
187188
tag_image
189+
build_failed=0
188190
break
189191
fi
190192

191193
rm -f "$tmp_file"
192194
done
195+
if [[ $build_failed -ne 0 ]]; then
196+
echo "-> Build failed for version $dir and OS $OS after 2 attempts, giving up."
197+
exit 1
198+
fi
193199

194200
}
195201

0 commit comments

Comments
 (0)