Use existing registry mirror for PostgreSQL CI
This commit is contained in:
@@ -81,23 +81,24 @@ jobs:
|
||||
|
||||
- name: Preload PostgreSQL integration image
|
||||
env:
|
||||
POSTGRES_TEST_SOURCE_IMAGE: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/postgres:17-alpine
|
||||
POSTGRES_TEST_IMAGE: postgres:17-alpine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if docker image inspect "$POSTGRES_TEST_IMAGE" >/dev/null 2>&1; then
|
||||
exit 0
|
||||
if ! docker image inspect "$POSTGRES_TEST_IMAGE" >/dev/null 2>&1; then
|
||||
for attempt in 1 2 3; do
|
||||
if timeout 180 docker pull "$POSTGRES_TEST_SOURCE_IMAGE"; then
|
||||
docker tag "$POSTGRES_TEST_SOURCE_IMAGE" "$POSTGRES_TEST_IMAGE"
|
||||
break
|
||||
fi
|
||||
if [ "$attempt" -eq 3 ]; then
|
||||
echo "Failed to preload $POSTGRES_TEST_IMAGE after $attempt attempts" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep $((attempt * 15))
|
||||
done
|
||||
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
|
||||
docker image inspect "$POSTGRES_TEST_IMAGE" >/dev/null
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user