kaspad/telegram.sh
Svarog 1cd2eb9308 [NOD-494] Update readmes (#543)
* [NOD-494] Updated main README.md

* [NOD-494] Updated blockdag/README.md

* [NOD-494] Aligned text length in main README.md

* [NOD-494] Updated most remaining packages READMEs + deleted util/coinset

* [NOD-494] Update integration README

* [NOD-494] Did a final pass over all readmes

* [NOD-494] Updated README for DNSSeeder with more info on how to create a functioning setup

* [NOD-494] Remove all double spaces from readmes

* [NOD-494] Minor fixes in READMEs + update license to kaspanet developers

* [NOD-494] Add backtick around ecc and util in hdkeychain README
2019-12-16 17:37:17 +02:00

35 lines
859 B
Bash
Executable File

#!/bin/sh
# This file is part of Continuous Integration. When ran by
# the CI agent, it sends a some details about the build failure
# to a Telegram group.
API_TOKEN="$1"
CHAT_ID="$2"
BUILD_URL="$3"
PR_AUTHOR="$4"
PR_TITLE="$5"
PR_LINK="$6"
# Build the failure message
MESSAGE="*${PR_AUTHOR}*:
Build *FAILED* for pull request '${PR_TITLE}'
[Github](${PR_LINK}) [Jenkins](${BUILD_URL}console)"
# Send the failure message
curl -s \
-X POST \
"https://api.telegram.org/bot${API_TOKEN}/sendMessage" \
-d chat_id="${CHAT_ID}" \
-d parse_mode=markdown \
-d disable_web_page_preview=true \
-d text="${MESSAGE}"
# Retrieve the build log
LOG=$(curl ${BUILD_URL}consoleText)
# Send the build log
printf "$LOG" | curl \
"https://api.telegram.org/bot${API_TOKEN}/sendDocument" \
-F chat_id="${CHAT_ID}" \
-F document="@-;filename=build.log"