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
|
2020-02-07 23:42:09 +03:00
|
|
|
echo "usage: $(basename $0) [firefox|webkit] [--full-history] [--has-all-builds]"
|
2019-11-20 03:33:07 +03:00
|
|
|
echo
|
2019-11-26 04:33:32 +03:00
|
|
|
echo "List CDN status for browser"
|
2020-02-07 23:42:09 +03:00
|
|
|
echo
|
2019-11-20 03:33:07 +03:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-11-26 04:33:32 +03:00
|
|
|
if [[ $# == 0 ]]; then
|
|
|
|
echo "missing browser: 'firefox' or 'webkit'"
|
|
|
|
echo "try './$(basename $0) --help' for more information"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-11-20 03:33:07 +03:00
|
|
|
|
2019-11-26 05:14:04 +03:00
|
|
|
trap "cd $(pwd -P)" EXIT
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
2020-01-22 02:43:58 +03:00
|
|
|
HOST="https://playwright2.blob.core.windows.net/builds"
|
2019-11-26 04:33:32 +03:00
|
|
|
|
2020-07-02 22:09:27 +03:00
|
|
|
FFOX_REVISION=$(head -1 ../firefox/BUILD_NUMBER)
|
2019-11-26 04:33:32 +03:00
|
|
|
FFOX_ARCHIVES=(
|
2020-07-24 10:31:18 +03:00
|
|
|
"$HOST/firefox/%s/firefox-mac-10.14.zip"
|
2020-07-24 03:32:43 +03:00
|
|
|
"$HOST/firefox/%s/firefox-ubuntu-18.04.zip"
|
2019-11-23 02:44:46 +03:00
|
|
|
"$HOST/firefox/%s/firefox-win32.zip"
|
2019-11-23 07:49:40 +03:00
|
|
|
"$HOST/firefox/%s/firefox-win64.zip"
|
2019-11-19 05:18:28 +03:00
|
|
|
)
|
2019-11-26 04:33:32 +03:00
|
|
|
FFOX_ALIASES=(
|
2019-11-19 05:18:28 +03:00
|
|
|
"FF-MAC"
|
2020-07-24 03:32:43 +03:00
|
|
|
"FF-UBUNTU-18.04"
|
2019-11-23 07:49:40 +03:00
|
|
|
"FF-WIN32"
|
|
|
|
"FF-WIN64"
|
2019-11-26 04:33:32 +03:00
|
|
|
)
|
|
|
|
|
2020-07-02 22:09:27 +03:00
|
|
|
WK_REVISION=$(head -1 ../webkit/BUILD_NUMBER)
|
2019-11-26 04:33:32 +03:00
|
|
|
WK_ARCHIVES=(
|
2020-07-24 10:31:18 +03:00
|
|
|
"$HOST/webkit/%s/webkit-ubuntu-18.04.zip"
|
|
|
|
"$HOST/webkit/%s/webkit-ubuntu-20.04.zip"
|
|
|
|
"$HOST/webkit/%s/webkit-mac-10.14.zip"
|
|
|
|
"$HOST/webkit/%s/webkit-mac-10.15.zip"
|
|
|
|
"$HOST/webkit/%s/webkit-win64.zip"
|
2019-11-26 04:33:32 +03:00
|
|
|
)
|
|
|
|
WK_ALIASES=(
|
2020-07-24 03:32:43 +03:00
|
|
|
"WK-UBUNTU-18.04"
|
|
|
|
"WK-UBUNTU-20.04"
|
2019-11-19 05:18:28 +03:00
|
|
|
"WK-MAC-10.14"
|
|
|
|
"WK-MAC-10.15"
|
2020-01-17 02:32:50 +03:00
|
|
|
"WK-WIN64"
|
2019-11-19 05:18:28 +03:00
|
|
|
)
|
|
|
|
|
2020-07-24 03:32:43 +03:00
|
|
|
COLUMN="%-18s"
|
2019-11-19 05:18:28 +03:00
|
|
|
# COLORS
|
|
|
|
RED=$'\e[1;31m'
|
|
|
|
GRN=$'\e[1;32m'
|
|
|
|
YEL=$'\e[1;33m'
|
|
|
|
END=$'\e[0m'
|
|
|
|
|
2019-11-26 04:33:32 +03:00
|
|
|
REVISION=""
|
|
|
|
ARCHIVES=""
|
|
|
|
ALIASES=""
|
|
|
|
if [[ ("$1" == "firefox") || ("$1" == "firefox/") ]]; then
|
|
|
|
REVISION=$FFOX_REVISION
|
|
|
|
ARCHIVES=("${FFOX_ARCHIVES[@]}")
|
|
|
|
ALIASES=("${FFOX_ALIASES[@]}")
|
|
|
|
elif [[ ("$1" == "webkit") || ("$1" == "webkit/") ]]; then
|
2019-11-20 03:33:07 +03:00
|
|
|
REVISION=$WK_REVISION
|
2019-11-26 04:33:32 +03:00
|
|
|
ARCHIVES=("${WK_ARCHIVES[@]}")
|
|
|
|
ALIASES=("${WK_ALIASES[@]}")
|
|
|
|
else
|
|
|
|
echo ERROR: unknown browser - "$1"
|
|
|
|
exit 1
|
2019-11-19 05:18:28 +03:00
|
|
|
fi
|
|
|
|
|
2020-02-07 23:42:09 +03:00
|
|
|
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
|
|
|
|
|
2020-01-09 02:30:12 +03:00
|
|
|
STOP_REVISION=$((REVISION - 3))
|
|
|
|
if [[ $* == *--full-history* ]]; then
|
|
|
|
STOP_REVISION=0
|
|
|
|
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"
|
2020-01-09 02:30:12 +03:00
|
|
|
while (( REVISION > $STOP_REVISION )); do
|
2019-11-20 03:33:07 +03:00
|
|
|
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-23 07:32:21 +03:00
|
|
|
if [[ $REVISION == "999" ]]; then
|
|
|
|
REVISION=2
|
|
|
|
fi
|
2019-11-19 05:18:28 +03:00
|
|
|
done;
|