devops: disable previews on telegram bot messages

This commit is contained in:
Andrey Lushnikov 2020-04-20 04:24:18 -07:00
Родитель e0d3e4811d
Коммит b8259837a4
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -9,6 +9,6 @@ send_telegram_message() {
curl --silent \
-X POST \
-H 'Content-Type: application/json' \
-d '{"chat_id": "-1001225613794", "parse_mode": "html", "text": "'"$TEXT"'", "disable_notification": false}' \
-d '{"disable_web_page_preview": true, "chat_id": "-1001225613794", "parse_mode": "html", "text": "'"$TEXT"'", "disable_notification": false}' \
https://api.telegram.org/bot$TELEGRAM_BOT_KEY/sendMessage >/dev/null
}

Просмотреть файл

@ -117,7 +117,8 @@ trap "rm -rf ${ZIP_PATH}; rm -rf ${LOG_PATH}; cd $(pwd -P);" INT TERM EXIT
cd "$(dirname "$0")"
BUILD_NUMBER=$(cat ./$BROWSER_NAME/BUILD_NUMBER)
BUILD_BLOB_PATH="${BROWSER_NAME}/${BUILD_NUMBER}/${BUILD_BLOB_NAME}"
LOG_BLOB_PATH="${BROWSER_NAME}/${BUILD_NUMBER}/${BUILD_BLOB_NAME%.zip}.log.gz"
LOG_BLOB_NAME="${BUILD_BLOB_NAME%.zip}.log.gz"
LOG_BLOB_PATH="${BROWSER_NAME}/${BUILD_NUMBER}/${LOG_BLOB_NAME}"
# pull from upstream and check if a new build has to be uploaded.
if ! [[ ($2 == '-f') || ($2 == '--force') ]]; then
@ -213,6 +214,6 @@ else
fi
# Upload logs only in case of failure and report failure.
./upload.sh ${LOG_BLOB_PATH} ${LOG_PATH} || true
send_telegram_message "$BUILD_ALIAS -- ${FAILED_STEP} failed! ❌ <a href='https://playwright.azureedge.net/builds/${LOG_BLOB_PATH}'>see logs</a>"
send_telegram_message "$BUILD_ALIAS -- ${FAILED_STEP} failed! ❌ <a href='https://playwright.azureedge.net/builds/${LOG_BLOB_PATH}'>${LOG_BLOB_NAME}</a>"
fi