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