playwright/browser_patches/tools/check_cdn.sh

72 lines
1.5 KiB
Bash
Raw Normal View History

2019-11-19 05:18:28 +03:00
#!/bin/bash
set -e
set +x
2019-11-20 03:33:07 +03:00
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
2019-11-20 21:31:26 +03:00
echo "usage: $(basename $0) [revision-to-start]"
2019-11-20 03:33:07 +03:00
echo
echo "List CDN status for browser revisions"
echo "Pass optional |revision-to-start| to limit revision search"
exit 0
fi
2019-11-19 05:18:28 +03:00
HOST="https://playwrightaccount.blob.core.windows.net/builds"
ARCHIVES=(
"$HOST/firefox/%s/firefox-mac.zip"
"$HOST/firefox/%s/firefox-linux.zip"
2019-11-23 02:44:46 +03:00
"$HOST/firefox/%s/firefox-win32.zip"
2019-11-19 05:18:28 +03:00
"$HOST/webkit/%s/minibrowser-linux.zip"
2019-11-22 04:06:57 +03:00
"$HOST/webkit/%s/minibrowser-mac-10.14.zip"
"$HOST/webkit/%s/minibrowser-mac-10.15.zip"
2019-11-19 05:18:28 +03:00
)
ALIASES=(
"FF-MAC"
"FF-LINUX"
"FF-WIN"
2019-11-22 04:06:57 +03:00
"WK-LINUX"
2019-11-19 05:18:28 +03:00
"WK-MAC-10.14"
"WK-MAC-10.15"
)
COLUMN="%-15s"
# COLORS
RED=$'\e[1;31m'
GRN=$'\e[1;32m'
YEL=$'\e[1;33m'
END=$'\e[0m'
2019-11-20 03:33:07 +03:00
trap "cd $(pwd -P)" EXIT
cd "$(dirname "$0")"
2019-11-21 05:02:36 +03:00
FFOX_REVISION=$(cat ../firefox/BUILD_NUMBER)
WK_REVISION=$(cat ../webkit/BUILD_NUMBER)
2019-11-20 03:33:07 +03:00
REVISION=$FFOX_REVISION
if (( FFOX_REVISION < WK_REVISION )); then
REVISION=$WK_REVISION
fi
2019-11-20 21:31:26 +03:00
# Read start revision if there's any.
2019-11-19 05:18:28 +03:00
if [[ $# == 1 ]]; then
2019-11-20 03:33:07 +03:00
REVISION=$1
2019-11-19 05:18:28 +03:00
fi
2019-11-20 03:33:07 +03:00
printf "%7s" ""
2019-11-19 05:18:28 +03:00
for i in "${ALIASES[@]}"; do
printf $COLUMN $i
done
printf "\n"
2019-11-20 03:33:07 +03:00
while (( REVISION > 0 )); do
printf "%-7s" ${REVISION}
2019-11-19 05:18:28 +03:00
for i in "${ARCHIVES[@]}"; do
URL=$(printf $i $REVISION)
if [[ $(curl -s -L -I $URL | head -1 | cut -f2 -d' ') == 200 ]]; then
printf ${GRN}$COLUMN${END} "YES"
else
printf ${RED}$COLUMN${END} "NO"
fi
done;
echo
2019-11-20 03:33:07 +03:00
REVISION=$((REVISION - 1 ))
2019-11-19 05:18:28 +03:00
done;