DevOpsprompt onlyIntermediate

Deployment Until Healthy

This loop automates the deployment process of a web application and ensures it becomes healthy by continuously checking its health endpoint. It iterates through deployment actions and health checks until the application is confirmed healthy or the maximum iteration limit is reached, providing visibility into the deployment process and preventing stuck deployments.

← all loops
devopsdeploymenthealth-checkmonitoringautomationiteration-loopcurlhttp-status

Goal

Successfully deploy application and confirm health status through endpoint checks

How to Run

Initiate deployment process and let the agent handle iterative health checks until success or max iterations

  1. 01

    Prepare your environment

    Ensure you're in the correct project directory with deployment scripts and configuration files ready

  2. 02

    Provide deployment context

    Share any necessary environment variables, health endpoint URL, or deployment commands when prompted

  3. 03

    Start the loop

    Use the kickoff prompt to begin the automated deployment and health check cycle

  4. 04

    Monitor progress

    Observe the agent's actions and health check results through console output or logs

Workflow Steps

  1. 01

    Deploy application

    Execute deployment script or commands to start/restart the application service

  2. 02

    Run health check command

    Execute curl command against the configured health endpoint to verify application is responding

  3. 03

    Inspect health check result

    Analyze HTTP response code: 200 means healthy, other codes indicate issues requiring investigation

  4. 04

    Evaluate exit condition

    If healthy, terminate loop successfully; if not and under iteration limit, return to step 1

  5. 05

    Handle iteration limit

    If max iterations reached without healthy status, escalate with detailed error information

Kickoff Prompt

Start the "Deployment Until Healthy" loop.

Goal: Successfully deploy application and confirm health status through endpoint checks
Max iterations: 10
Between iterations run: curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health
Exit when: Health check returns HTTP 200 status code


Deploy this application and check its health endpoint at http://localhost:8080/health. Run the deployment process iteratively until the health check returns HTTP 200 or you've attempted 10 times. After each deployment, wait 10 seconds before checking health again. Document each attempt and its result.

Self-pace this loop. After each iteration, run `curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health` and evaluate the output, and only continue if the exit condition is not met (Health check returns HTTP 200 status code). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Only perform health check GET requests to prevent data modification
  • ·Respect the 10-iteration maximum to prevent infinite loops
  • ·Log all deployment attempts and their outcomes for audit purposes
  • ·Validate environment configuration before attempting deployment
  • ·Implement exponential backoff between retry attempts
  • ·Stop immediately if health check endpoint is unreachable or returns 5xx errors persistently

Flow Diagram

rendering…

Related loops — DevOps