Force push for images and proper interruption when pulling images fail.
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-01-01 22:27:47 +05:00
parent edb14e5112
commit 21666b4de3
2 changed files with 9 additions and 4 deletions
+9 -3
View File
@@ -135,6 +135,8 @@ function mirror() {
# We presumes that amd64 image should always be available.
if ! get_amd64_image "${image}"; then
echo "! Image mirroring failed! Cannot obtain amd64 image!"
return 1
fi
get_arm64_image "${image}"
@@ -145,13 +147,13 @@ function mirror() {
function push_multiarch_image() {
local image=$1
if ! docker push "${REMOTE_IMAGE}"-amd64 &> /dev/null; then
if ! docker push -f "${REMOTE_IMAGE}"-amd64 &> /dev/null; then
echo -e "\t! amd64 image push failed!"
else
echo -e "\t* amd64 image pushed"
fi
if ! docker push "${REMOTE_IMAGE}"-arm64 &> /dev/null; then
if ! docker push -f ="${REMOTE_IMAGE}"-arm64 &> /dev/null; then
echo -e "\t! arm64 image push failed!"
else
echo -e "\t* arm64 image pushed"
@@ -186,5 +188,9 @@ login_to_registry
collect_images
for package in "${WHAT_TO_MIRROR[@]}"; do
mirror "${package}"
if ! mirror "${package}"; then
echo "! Failed to mirror package ${package}!"
exit 1
fi
done