summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-02-05 11:04:13 +0100
committerJames Lopez <james@jameslopez.es>2016-02-05 11:04:13 +0100
commit0309e0818a9d73af0157ce36b2306d5723e7fb97 (patch)
treefc00e4de4f0c29dded0ec481e803d5cfbd81c2ae /scripts
parent70f82cc5ac08c2129f3a10dd1155f43eaecd2e03 (diff)
downloadgitlab-ce-0309e0818a9d73af0157ce36b2306d5723e7fb97.tar.gz
removed slack task and added bash script instead. Updated gitlab-ci config file
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/notify_slack.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/notify_slack.sh b/scripts/notify_slack.sh
new file mode 100755
index 00000000000..0a4239e132c
--- /dev/null
+++ b/scripts/notify_slack.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+# Sends Slack notification ERROR_MSG to CHANNEL
+# An env. variable CI_SLACK_WEBHOOK_URL needs to be set.
+
+CHANNEL=$1
+ERROR_MSG=$2
+
+if [ -z "$CHANNEL" ] || [ -z "$ERROR_MSG" ] || [ -z "$CI_SLACK_WEBHOOK_URL" ]; then
+ echo "Missing argument(s) - Use: $0 channel message"
+ echo "and set CI_SLACK_WEBHOOK_URL environment variable."
+else
+ curl -X POST --data-urlencode 'payload={"channel": "'"$CHANNEL"'", "username": "gitlab-ci", "text": "'"$ERROR_MSG"'", "icon_emoji": ":gitlab:"}' "$CI_SLACK_WEBHOOK_URL"
+fi \ No newline at end of file