CICD-197 · Retry a bounded idempotent request
Encyclopedia · CI diagnostics and evidence · All snippets
Previous · CICD-196 · Next · CICD-198
1. Where it fits
- Placement Bash run step following checkout, or equivalent lab terminal.
- Prerequisites authorized fixture run and sanitized evidence location.
- Platforms local-linux, github-actions, gitea-actions.
- Parameters
HEALTH_URL.
2. Copy the snippet
bash
curl --fail --silent --show-error --retry 3 --retry-delay 1 --retry-max-time 10 --max-time 4 "${HEALTH_URL:?}"3. How it works
The request checks the selected HTTP interface. Timeouts limit waiting, and an explicit exit or payload condition determines pass and fail.
4. Verify the result
Retry only safe reads. Inspect the underlying error if the endpoint remains unhealthy.
Validation syntax-validated (Bash parse). Status definitions.