fix(ci): preflight registry DNS before IFT/stage deploy
CI / deploy-ift (push) Has been cancelled
CI / test (push) Successful in 25m20s
CI / e2e-ift (push) Has been cancelled
CI / deploy-stage (push) Has been cancelled
CI / e2e-stage (push) Has been cancelled

This commit is contained in:
2026-07-18 12:53:46 +03:00
parent 1cd7c2e402
commit fa07d91f4b
+35 -2
View File
@@ -237,9 +237,26 @@ jobs:
username: ${{ secrets.IFT_SSH_USER }}
key: ${{ secrets.IFT_SSH_PRIVATE_KEY }}
script: |
set -euo pipefail
export REGISTRY_USER='${{ secrets.REGISTRY_USER }}'
export REGISTRY_PASSWORD='${{ secrets.REGISTRY_PASSWORD }}'
bash /opt/eventhub-ift/devops/scripts/deploy-service.sh ift core ${{ steps.meta.outputs.tag }}
TAG='${{ steps.meta.outputs.tag }}'
# Host DNS preflight (Docker Desktop forwarder 192.168.*.1 часто timeout).
for i in 1 2 3 4 5; do
if getent ahostsv4 git.sabilin.com >/dev/null 2>&1 \
|| getent hosts git.sabilin.com >/dev/null 2>&1 \
|| dig +short git.sabilin.com A 2>/dev/null | grep -qE '^[0-9.]+$'; then
echo "OK: git.sabilin.com resolves on host"
break
fi
echo "wait DNS git.sabilin.com (${i}/5)..."
sleep $((i * 2))
if [[ "${i}" -eq 5 ]]; then
echo "FAIL: git.sabilin.com not resolvable on IFT host"
exit 1
fi
done
bash /opt/eventhub-ift/devops/scripts/deploy-service.sh ift core "${TAG}"
- name: Prune old registry images
env:
@@ -356,9 +373,25 @@ jobs:
username: ${{ secrets.STAGE_SSH_USER }}
key: ${{ secrets.STAGE_SSH_PRIVATE_KEY }}
script: |
set -euo pipefail
export REGISTRY_USER='${{ secrets.REGISTRY_USER }}'
export REGISTRY_PASSWORD='${{ secrets.REGISTRY_PASSWORD }}'
bash /opt/eventhub-stage/devops/scripts/deploy-service.sh stage core ${{ steps.meta.outputs.tag }}
TAG='${{ steps.meta.outputs.tag }}'
for i in 1 2 3 4 5; do
if getent ahostsv4 git.sabilin.com >/dev/null 2>&1 \
|| getent hosts git.sabilin.com >/dev/null 2>&1 \
|| dig +short git.sabilin.com A 2>/dev/null | grep -qE '^[0-9.]+$'; then
echo "OK: git.sabilin.com resolves on host"
break
fi
echo "wait DNS git.sabilin.com (${i}/5)..."
sleep $((i * 2))
if [[ "${i}" -eq 5 ]]; then
echo "FAIL: git.sabilin.com not resolvable on stage host"
exit 1
fi
done
bash /opt/eventhub-stage/devops/scripts/deploy-service.sh stage core "${TAG}"
- name: Prune old registry images
continue-on-error: true