Retry Docker Hub API calls on transient failures

This commit is contained in:
WasserEsser
2026-06-23 17:53:32 +02:00
parent 578dc37e6b
commit d741e966e5
+10 -1
View File
@@ -49,7 +49,16 @@ jobs:
PAGE=1 PAGE=1
ALL_TAGS="" ALL_TAGS=""
while true; do while true; do
RESPONSE=$(curl -sf "https://hub.docker.com/v2/repositories/mattermost/mattermost-enterprise-edition/tags/?page_size=100&page=${PAGE}") for ATTEMPT in 1 2 3; do
RESPONSE=$(curl -sf "https://hub.docker.com/v2/repositories/mattermost/mattermost-enterprise-edition/tags/?page_size=100&page=${PAGE}" && break) || {
if [ "$ATTEMPT" -eq 3 ]; then
echo "Failed to fetch Docker Hub tags after 3 attempts"
exit 1
fi
echo "Docker Hub API error (attempt $ATTEMPT/3), retrying in $((ATTEMPT * 5))s..."
sleep $((ATTEMPT * 5))
}
done
TAGS=$(echo "$RESPONSE" | python3 -c " TAGS=$(echo "$RESPONSE" | python3 -c "
import sys, json import sys, json
data = json.load(sys.stdin) data = json.load(sys.stdin)