Skip to content

Commit

Permalink
UBERF-8328: Fail CI on docker push failure (#6794)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Zinoviev <[email protected]>
  • Loading branch information
lexiv0re authored Oct 3, 2024
1 parent 563f44b commit 951fcf2
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions common/scripts/docker_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,46 @@ 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}"
docker tag "$1:$rev_version" "$1:$version"
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

0 comments on commit 951fcf2

Please sign in to comment.