From b8259837a4117e34ff4aef8ea5ab8061ea0e65e4 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 20 Apr 2020 04:24:18 -0700 Subject: [PATCH] devops: disable previews on telegram bot messages --- browser_patches/buildbots/send_telegram_message.sh | 2 +- browser_patches/checkout_build_archive_upload.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/browser_patches/buildbots/send_telegram_message.sh b/browser_patches/buildbots/send_telegram_message.sh index 2b70e2927a..7fb4bd248c 100644 --- a/browser_patches/buildbots/send_telegram_message.sh +++ b/browser_patches/buildbots/send_telegram_message.sh @@ -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 } diff --git a/browser_patches/checkout_build_archive_upload.sh b/browser_patches/checkout_build_archive_upload.sh index 5ddc13044e..a54bc60534 100755 --- a/browser_patches/checkout_build_archive_upload.sh +++ b/browser_patches/checkout_build_archive_upload.sh @@ -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! ❌ see logs" + send_telegram_message "$BUILD_ALIAS -- ${FAILED_STEP} failed! ❌ ${LOG_BLOB_NAME}" fi