summaryrefslogtreecommitdiff
path: root/scripts/slack
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-07 21:10:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-07 21:10:07 +0000
commitdb73de5d6de44f995179f04517bc91b041eb10d3 (patch)
treee1e903120e39dc618aeb6e3ed7540c4bb62b8fff /scripts/slack
parent5edd0d173ff0bc377348bf3585fa309eee783e32 (diff)
downloadgitlab-ce-db73de5d6de44f995179f04517bc91b041eb10d3.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/slack')
-rwxr-xr-xscripts/slack17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/slack b/scripts/slack
new file mode 100755
index 00000000000..60bc70a8542
--- /dev/null
+++ b/scripts/slack
@@ -0,0 +1,17 @@
+#!/bin/bash
+# This is copied from:
+# https://gitlab.com/gitlab-org/gitlab-qa/-/blob/master/bin/slack
+#
+# Sends Slack notification MSG to CI_SLACK_WEBHOOK_URL (which needs to be set).
+# ICON_EMOJI needs to be set to an icon emoji name (without the `:` around it).
+
+CHANNEL=$1
+MSG=$2
+ICON_EMOJI=$3
+
+if [ -z "$CHANNEL" ] || [ -z "$CI_SLACK_WEBHOOK_URL" ] || [ -z "$MSG" ] || [ -z "$ICON_EMOJI" ]; then
+ echo "Missing argument(s) - Use: $0 channel message icon_emoji"
+ echo "and set CI_SLACK_WEBHOOK_URL environment variable."
+else
+ curl -X POST --data-urlencode 'payload={"channel": "#'"$CHANNEL"'", "username": "GitLab QA Bot", "text": "'"$MSG"'", "icon_emoji": "'":$ICON_EMOJI:"'"}' "$CI_SLACK_WEBHOOK_URL"
+fi