Retry PostgreSQL image preload in Gitea CI
Staging Backend Quality Gate / validate (pull_request) Failing after 3m18s
Staging Backend Quality Gate / publish (pull_request) Has been skipped

This commit is contained in:
Jesse_Chen
2026-08-05 12:37:15 +08:00
parent 7fe29dcf01
commit 0bccba89ec
2 changed files with 28 additions and 0 deletions
+20
View File
@@ -78,6 +78,26 @@ jobs:
docker compose version --short | grep -Eq '^v?2\.'
docker compose --help | grep -q -- '--project-name'
- name: Preload PostgreSQL integration image
env:
POSTGRES_TEST_IMAGE: postgres:17-alpine
run: |
set -euo pipefail
if docker image inspect "$POSTGRES_TEST_IMAGE" >/dev/null 2>&1; then
exit 0
fi
for attempt in 1 2 3; do
if timeout 180 docker pull "$POSTGRES_TEST_IMAGE"; then
docker image inspect "$POSTGRES_TEST_IMAGE" >/dev/null
break
fi
if [ "$attempt" -eq 3 ]; then
echo "Failed to pull $POSTGRES_TEST_IMAGE after $attempt attempts" >&2
exit 1
fi
sleep $((attempt * 15))
done
- name: Install dependencies
run: |
set -euo pipefail