diff options
Diffstat (limited to 'scripts/notify-slack.sh')
-rwxr-xr-x | scripts/notify-slack.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/notify-slack.sh b/scripts/notify-slack.sh new file mode 100755 index 0000000000..5b637e87af --- /dev/null +++ b/scripts/notify-slack.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u + +SLACK_CHANNEL=${SLACK_CHANNEL:-''} +SLACK_COLOR=${SLACK_COLOR:-''} + +curl -g -H "Content-Type: application/json" -X POST \ + -d "{\"channel\": \"$SLACK_CHANNEL\", \"attachments\": [{\"text\": \"$SLACK_MESSAGE\", \"color\": \"$SLACK_COLOR\", \"author_name\": \"$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME\"}]}" \ + $SLACK_WEBHOOK_URL |