-
Notifications
You must be signed in to change notification settings - Fork 0
Notifications
Fire events to Slack, Discord, or a generic webhook when deploys, backups, health checks, and drift detection run. Since v0.9.0.
Providers are configured in notifications.conf at the project root. Each provider subscribes to a list of events (or * for all). Notification failures always warn and never abort the underlying action.
Shell-style config, sourced at dispatch time. Create it alongside strut.conf:
# Slack
SLACK_WEBHOOK=https://hooks.slack.com/services/T000/B000/XYZ
SLACK_EVENTS=deploy.success,deploy.fail,health.fail
# Discord
DISCORD_WEBHOOK=https://discord.com/api/webhooks/000/XYZ
DISCORD_EVENTS=deploy.fail
# Generic webhook (any JSON POST receiver)
WEBHOOK_URL=https://ops.example.com/strut
WEBHOOK_EVENTS=*Search order for the config file:
-
$NOTIFICATIONS_CONFenv var $PROJECT_ROOT/notifications.conf$CLI_ROOT/notifications.conf
strut fires these events from the command handlers:
| Event | When |
|---|---|
deploy.success |
Deploy / release completed |
deploy.fail |
Deploy / release failed |
backup.success |
Any backup <type> succeeded |
backup.fail |
Backup failed |
health.fail |
A health check reported a failure |
drift.detected |
drift detect found differences |
test.ping |
Emitted by strut notify test <provider>
|
Subscribe to a subset in each provider's *_EVENTS CSV, or use * for every event.
Each notification carries:
-
event— the event name -
stack— stack name (when known) -
env— environment name (when known) - Event-specific fields (e.g.
type=postgresforbackup.success)
The generic webhook receives this as JSON via POST. Slack and Discord providers format it into a human-readable message.
strut notify test slack
strut notify test discord
strut notify test webhookEach sends a single test.ping event through the named provider, using whatever is configured in notifications.conf. Fails loudly if the webhook URL isn't set.
Under --dry-run, strut emits a [notify:dry-run] event=<name> payload=… line to stdout instead of hitting the network. Useful for verifying event firing without spamming a channel.
The Monitoring page covers Prometheus / Grafana / Alertmanager — a full self-hosted observability stack. Notifications here are a lightweight alternative: per-event pings straight from strut commands, no extra infrastructure. Use both together if you want both deploy pings and ongoing metric alerts.
- Monitoring — Prometheus-based alerting with richer alert routing
- Lifecycle Hooks — drop into user scripts for custom notification logic
strut · v0.1.0 · Report an Issue
Getting Started
Core Concepts
Operations
- Deployment
- Blue-Green Deploy
- Deploy Rollback
- Database Backups
- Stack Groups
- Lifecycle Hooks
- Notifications
- Key Rotation
- Drift Detection
- Domain and SSL
- Monitoring
- Volume Management
Advanced
- Security Posture
- VPS Audit and Migration
- Stack Validation
- Data Anonymization
- Debugging
- Local Development
Extending
Contributing