Skip to content

Commit

Permalink
devops: prettify telegram messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Feb 7, 2020
1 parent 42c2cfc commit 8712359
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
15 changes: 11 additions & 4 deletions browser_patches/checkout_build_archive_upload.sh
Expand Up @@ -121,10 +121,9 @@ fi
cd -

source ./buildbots/send_telegram_message.sh
LAST_COMMIT_MESSAGE=$(git log --format=%s -n 1 HEAD -- ./$BROWSER_NAME/BUILD_NUMBER)
BUILD_ALIAS="<b>[[$BUILD_FLAVOR r$BUILD_NUMBER]]</b> $LAST_COMMIT_MESSAGE"
BUILD_ALIAS="$BUILD_FLAVOR r$BUILD_NUMBER"

send_telegram_message "$BUILD_ALIAS -- started"
send_telegram_message "$BUILD_ALIAS -- started"

if [[ "$BUILD_FLAVOR" == "webkit-gtk-wpe" ]]; then
echo "-- combining binaries together"
Expand Down Expand Up @@ -164,4 +163,12 @@ if ! ./upload.sh $BUILD_FLAVOR $ZIP_PATH; then
exit 1
fi
UPLOAD_SIZE=$(du -h "$ZIP_PATH" | awk '{print $1}')
send_telegram_message "$BUILD_ALIAS -- $UPLOAD_SIZE uploaded ✅"
send_telegram_message "$BUILD_ALIAS -- $UPLOAD_SIZE uploaded"

if ./tools/check_cdn.sh $BROWSER_NAME --has-all-builds; then
LAST_COMMIT_MESSAGE=$(git log --format=%s -n 1 HEAD -- ./$BROWSER_NAME/BUILD_NUMBER)
send_telegram_message "<b>$BROWSER_NAME r${BUILD_NUMBER} COMPLETE! ✅</b> $LAST_COMMIT_MESSAGE"
fi



13 changes: 12 additions & 1 deletion browser_patches/tools/check_cdn.sh
Expand Up @@ -3,9 +3,10 @@ set -e
set +x

if [[ ($1 == '--help') || ($1 == '-h') ]]; then
echo "usage: $(basename $0) [firefox|webkit] [--full-history]"
echo "usage: $(basename $0) [firefox|webkit] [--full-history] [--has-all-builds]"
echo
echo "List CDN status for browser"
echo
exit 0
fi

Expand Down Expand Up @@ -75,6 +76,16 @@ else
exit 1
fi

if [[ $* == *--has-all-builds ]]; then
for i in "${ARCHIVES[@]}"; do
URL=$(printf $i $REVISION)
if ! [[ $(curl -s -L -I $URL | head -1 | cut -f2 -d' ') == 200 ]]; then
exit 1
fi
done;
exit 0
fi

STOP_REVISION=$((REVISION - 3))
if [[ $* == *--full-history* ]]; then
STOP_REVISION=0
Expand Down

0 comments on commit 8712359

Please sign in to comment.