Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 18:06:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-01 18:06:05 +0300
commit05f4b2fb34dbb051b2ce5ddbc801ec42998c019c (patch)
tree0fd7a153f3ed7d00d40e428c08ab81ae3d863afe /scripts
parent9e27f0d920cc3891fa7644c5cc0bc280c519fb20 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/notify-slack14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/notify-slack b/scripts/notify-slack
new file mode 100755
index 00000000000..5907fd8b986
--- /dev/null
+++ b/scripts/notify-slack
@@ -0,0 +1,14 @@
+#!/bin/bash
+# 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