CI: stronger docker retry (5x60s, prune cache, pull, push retry).
CI / test (push) Successful in 22m8s
CI / test (push) Successful in 22m8s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+14
-9
@@ -28,8 +28,10 @@ jobs:
|
||||
- name: Build eventhub image
|
||||
run: |
|
||||
set -euo pipefail
|
||||
bash scripts/retry-docker-build.sh 3 30 -- \
|
||||
bash scripts/retry-docker-build.sh 5 60 -- \
|
||||
docker buildx build \
|
||||
--network=host \
|
||||
--pull \
|
||||
--file docker/Dockerfile \
|
||||
--tag eventhub:latest \
|
||||
--load \
|
||||
@@ -40,8 +42,10 @@ jobs:
|
||||
- name: Build API test image
|
||||
run: |
|
||||
set -euo pipefail
|
||||
bash scripts/retry-docker-build.sh 3 30 -- \
|
||||
bash scripts/retry-docker-build.sh 5 60 -- \
|
||||
docker buildx build \
|
||||
--network=host \
|
||||
--pull \
|
||||
--file docker/ApiTests.Dockerfile \
|
||||
--tag eventhub-api-tests:latest \
|
||||
--load \
|
||||
@@ -54,11 +58,12 @@ jobs:
|
||||
|
||||
- name: Login to registry
|
||||
if: github.event_name == 'push'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: git.sabilin.com
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
env:
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
run: |
|
||||
bash scripts/retry-docker-build.sh 5 30 -- \
|
||||
bash -c 'echo "${REGISTRY_PASSWORD}" | docker login git.sabilin.com -u "${REGISTRY_USER}" --password-stdin'
|
||||
|
||||
- name: Push tested eventhub image
|
||||
if: github.event_name == 'push'
|
||||
@@ -67,5 +72,5 @@ jobs:
|
||||
TAG="sha-${GITHUB_SHA:0:12}"
|
||||
docker tag eventhub:latest "${REGISTRY}/eventhub:${TAG}"
|
||||
docker tag eventhub:latest "${REGISTRY}/eventhub:ift"
|
||||
docker push "${REGISTRY}/eventhub:${TAG}"
|
||||
docker push "${REGISTRY}/eventhub:ift"
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub:${TAG}"
|
||||
bash scripts/retry-docker-build.sh 5 30 -- docker push "${REGISTRY}/eventhub:ift"
|
||||
|
||||
@@ -28,6 +28,7 @@ while true; do
|
||||
exit "${code}"
|
||||
fi
|
||||
echo "== attempt ${attempt} failed (exit ${code}), retry in ${WAIT}s..."
|
||||
docker buildx prune -f >/dev/null 2>&1 || true
|
||||
sleep "${WAIT}"
|
||||
attempt=$((attempt + 1))
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user