After a successful deploy, muster runs the service's health.sh hook (if health is enabled and the hook exists). Exit 0 means healthy, non-zero means unhealthy.
Configure health check types during muster setup or via CLI flags:
| Name | Description |
|---|---|
HTTP | http:<endpoint>:<port>HTTP endpoint check. Example: --health api=http:/health:8080 |
TCP | tcp:<port>TCP port check. Example: --health redis=tcp:6379 |
Command | command:<cmd>Custom command check. Example: --health worker=command:./check.sh |
Disabled | noneDisable health checks. Example: --health api=none |
If the health check fails after deploy, an interactive menu offers:
| Name | Description |
|---|---|
Continue anyway | actionProceed to next service. |
Rollback <name> | actionRun the rollback hook for the failed service. |
Abort | actionStop the deploy. |
| Name | Description |
|---|---|
Production | durationHealth check timeout for production environments. Default: 30s |
Staging | durationHealth check timeout for staging environments. Default: 15s |
Development | durationHealth check timeout for development environments. Default: 5s |
The health.sh hook receives the same environment variables as other hooks. Exit 0 for healthy, non-zero for unhealthy.
#!/usr/bin/env bash
set -euo pipefail
# Check HTTP endpoint
curl -sf http://localhost:8080/health > /dev/null || exit 1
# Verify database connectivity
pg_isready -h db -U app || exit 1
echo "All health checks passed"