UBERF-8328: Fail CI on docker push failure (#6794)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2024-10-03 18:18:42 +07:00
committed by GitHub
parent 563f44bb66
commit 951fcf2afa
+28 -7
View File
@@ -9,12 +9,19 @@ then
c=( ${a[2]//[^0-9]*/ } )
((c++))
version="${a[0]}.${a[1]}.${c}-staging"
echo "Tagging stating $1 with version ${version}"
echo "Tagging staging $1 with version ${version}"
docker tag "$1:$rev_version" "$1:$version"
for n in {1..5}; do
docker push "$1:$version" && break
echo 'Docker failed to push, wait 5 seconds'
sleep 5
if (( $n < 5 ))
then
echo 'Docker failed to push, wait 5 second'
sleep 5
else
echo '5 push attempts failed, exiting with failure'
exit 1
fi
done
else
echo "Tagging release $1 with version ${version}"
@@ -22,12 +29,26 @@ else
docker tag "$1:$rev_version" "$1:latest"
for n in {1..5}; do
docker push "$1:$version" && break
echo 'Docker failed to push, wait 5 seconds'
sleep 5
if (( $n < 5 ))
then
echo 'Docker failed to push, wait 5 second'
sleep 5
else
echo '5 push attempts failed, exiting with failure'
exit 1
fi
done
for n in {1..5}; do
docker push "$1:latest" && break
echo 'Docker failed to push, wait 5 seconds'
sleep 5
if (( $n < 5 ))
then
echo 'Docker failed to push, wait 5 second'
sleep 5
else
echo '5 push attempts failed, exiting with failure'
exit 1
fi
done
fi