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

This commit is contained in:
Stanislav Nikitin 2023-01-01 22:27:47 +05:00
parent edb14e5112
commit 21666b4de3
No known key found for this signature in database
GPG Key ID: 9A63857413C83B4A
2 changed files with 9 additions and 4 deletions

View File

@ -32,7 +32,6 @@ steps:
REGISTRY_USERNAME: drone
REGISTRY_PASSWORD:
from_secret: drone_secret
DOCKER_MAX_CONCURRENT_UPLOADS: 1
commands:
- apk add --no-cache bash
- ./mirror.sh

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