Wire a systemd OnFailure= unit that posts build ID and last 10 lines of pipeline.log to a Discord webhook when the pipeline exits non-zero. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
10 lines
243 B
Django/Jinja
10 lines
243 B
Django/Jinja
[Unit]
|
|
Description=Discord notification for %i failure
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
User=deploy
|
|
Group=www-data
|
|
EnvironmentFile={{ app_root }}/shared/.env
|
|
Environment=NOTIFY_UNIT=%i
|
|
ExecStart={{ app_root }}/shared/scripts/notify-pipeline-failure.sh
|