debian-forge-composer/schutzbot/slack_notification.sh
Jakub Rusz 0b962c9185 ci: add slack notfications
This sends a message to a slack channel if a scheduled pipeline is
ran and reports either failure or success.
2021-07-12 11:21:01 +03:00

12 lines
382 B
Bash
Executable file

#!/bin/bash
set -eux
COMPOSE_ID=$(cat COMPOSE_ID)
MESSAGE="\"Nightly pipeline execution on *$COMPOSE_ID* finished with status *$1* $2 \n Link to results: $CI_PIPELINE_URL \""
curl \
-X POST \
-H 'Content-type: application/json' \
--data '{"text": "test", "blocks": [ { "type": "section", "text": {"type": "mrkdwn", "text":'"$MESSAGE"'}}]}' \
"$SLACK_WEBHOOK_URL"