summaryrefslogtreecommitdiffstats
path: root/tests/installer/slack.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:08 +0000
commit315e0143f65da3485dcbcd2f6a3172a351618aec (patch)
treeb713ae472cffab249c95917c6fb6d242d54e0a87 /tests/installer/slack.sh
parentAdding upstream version 1.18.1. (diff)
downloadnetdata-315e0143f65da3485dcbcd2f6a3172a351618aec.tar.xz
netdata-315e0143f65da3485dcbcd2f6a3172a351618aec.zip
Adding upstream version 1.19.0.upstream/1.19.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/installer/slack.sh')
-rwxr-xr-xtests/installer/slack.sh65
1 files changed, 0 insertions, 65 deletions
diff --git a/tests/installer/slack.sh b/tests/installer/slack.sh
deleted file mode 100755
index 83cb5fa7c..000000000
--- a/tests/installer/slack.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-# #No shebang necessary
-# BASH Lib: Simple incoming webhook for slack integration.
-#
-# The script expects the following parameters to be defined by the upper layer:
-# SLACK_NOTIFY_WEBHOOK_URL
-# SLACK_BOT_NAME
-# SLACK_CHANNEL
-#
-# Copyright:
-#
-# Author: Pavlos Emm. Katsoulakis <paul@netdata.cloud
-
-post_message() {
- TYPE="$1"
- MESSAGE="$2"
- CUSTOM_CHANNEL="$3"
-
- case "$TYPE" in
- "PLAIN_MESSAGE")
- curl -X POST --data-urlencode "payload={\"channel\": \"${SLACK_CHANNEL}\", \"username\": \"${SLACK_BOT_NAME}\", \"text\": \"${MESSAGE}\", \"icon_emoji\": \":space_invader:\"}" ${SLACK_NOTIFY_WEBHOOK_URL}
- ;;
- "TRAVIS_MESSAGE")
- EVENT_LINE="${TRAVIS_JOB_NUMBER}: Event type '${TRAVIS_EVENT_TYPE}', on '${TRAVIS_OS_NAME}'"
- if [ "$TRAVIS_EVENT_TYPE}" == "pull_request" ]; then
- EVENT_LINE="${TRAVIS_JOB_NUMBER}: Event type '${TRAVIS_EVENT_TYPE}' #${TRAVIS_PULL_REQUEST}, on '${TRAVIS_OS_NAME}' "
- fi
-
- if [ -n "${CUSTOM_CHANNEL}" ]; then
- echo "Sending travis message to custom channel ${CUSTOM_CHANNEL}"
- OPTIONAL_CHANNEL_INFO="\"channel\": \"${CUSTOM_CHANNEL}\","
- fi
-
- POST_MESSAGE="{
- ${OPTIONAL_CHANNEL_INFO}
- \"text\": \"${TRAVIS_REPO_SLUG}, ${MESSAGE}\",
- \"attachments\": [{
- \"text\": \"${TRAVIS_JOB_NUMBER}: Event type '${TRAVIS_EVENT_TYPE}', on '${TRAVIS_OS_NAME}' \",
- \"fallback\": \"I could not determine the build\",
- \"callback_id\": \"\",
- \"color\": \"#3AA3E3\",
- \"attachment_type\": \"default\",
- \"actions\": [
- {
- \"name\": \"${TRAVIS_BUILD_NUMBER}\",
- \"text\": \"Build #${TRAVIS_BUILD_NUMBER}\",
- \"type\": \"button\",
- \"url\": \"${TRAVIS_BUILD_WEB_URL}\"
- },
- {
- \"name\": \"${TRAVIS_JOB_NUMBER}\",
- \"text\": \"Job #${TRAVIS_JOB_NUMBER}\",
- \"type\": \"button\",
- \"url\": \"${TRAVIS_JOB_WEB_URL}\"
- }]
- }]
- }"
- echo "Sending ${POST_MESSAGE}"
- curl -X POST --data-urlencode "payload=${POST_MESSAGE}" "${SLACK_NOTIFY_WEBHOOK_URL}"
- ;;
- *)
- echo "Unrecognized message type \"$TYPE\" was given"
- return 1
- ;;
- esac
-}