Skip to content

Commit

Permalink
devops: disable previews on telegram bot messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Apr 20, 2020
1 parent e0d3e48 commit b825983
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion browser_patches/buildbots/send_telegram_message.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
5 changes: 3 additions & 2 deletions browser_patches/checkout_build_archive_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit b825983

Please sign in to comment.