Skip to content

Commit 8dc7405

Browse files
authored
devops: refactor check_cdn.sh script (#5835)
Introduce `EXPECTED_BUILDS` list in each application folder and use these lists when determining if all builds are ready.
1 parent e64f666 commit 8dc7405

File tree

9 files changed

+65
-165
lines changed

9 files changed

+65
-165
lines changed

browser_patches/check_cdn.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
set -e
3+
set +x
4+
5+
if [[ ($1 == '--help') || ($1 == '-h') ]]; then
6+
echo "usage: $(basename $0) [firefox|webkit|chromium|ffmpeg] [--full-history] [--has-all-builds]"
7+
echo
8+
echo "List CDN status for browser"
9+
echo
10+
exit 0
11+
fi
12+
13+
if [[ $# == 0 ]]; then
14+
echo "missing browser: 'firefox', 'webkit', 'chromium' or 'ffmpeg'"
15+
echo "try './$(basename $0) --help' for more information"
16+
exit 1
17+
fi
18+
19+
trap "cd $(pwd -P)" EXIT
20+
cd "$(dirname "$0")"
21+
22+
HOST="https://playwright2.blob.core.windows.net/builds"
23+
24+
BROWSER_NAME="$1"
25+
if [[ (! -f "./${BROWSER_NAME}/BUILD_NUMBER") || (! -f "./${BROWSER_NAME}/EXPECTED_BUILDS") ]]; then
26+
echo ERROR: unknown application - "$1"
27+
exit 1
28+
fi
29+
30+
REVISION=$(head -1 "./${BROWSER_NAME}/BUILD_NUMBER")
31+
BUILD_NAMES="./${BROWSER_NAME}/EXPECTED_BUILDS"
32+
33+
for i in $(cat "${BUILD_NAMES}"); do
34+
URL="${HOST}/${BROWSER_NAME}/${REVISION}/$i"
35+
if ! [[ $(curl -s -L -I $URL | head -1 | cut -f2 -d' ') == 200 ]]; then
36+
echo "${BROWSER_NAME} r${REVISION} is missing build: $i"
37+
exit 1
38+
fi
39+
done;
40+
41+
echo "All expected builds are uploaded."

browser_patches/checkout_build_archive_upload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ if generate_and_upload_browser_build 2>&1 | ./sanitize_and_compress_log.js $LOG_
323323
send_telegram_message "$BUILD_ALIAS -- ${UPLOAD_SIZE}uploaded"
324324

325325
# Check if we uploaded the last build.
326-
if ./tools/check_cdn.sh $BROWSER_NAME --has-all-builds; then
326+
if ./check_cdn.sh $BROWSER_NAME > /dev/null; then
327327
LAST_COMMIT_MESSAGE=$(git log --format=%s -n 1 HEAD -- ./$BROWSER_NAME/BUILD_NUMBER)
328328
send_telegram_message "<b>$BROWSER_NAME r${BUILD_NUMBER} COMPLETE! ✅</b> $LAST_COMMIT_MESSAGE"
329329
fi
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
chromium-mac.zip
2+
chromium-mac-arm64.zip
3+
chromium-linux.zip
4+
chromium-win32.zip
5+
chromium-win64.zip
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deprecated-webkit-mac-10.14.zip
2+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ffmpeg-mac.zip
2+
ffmpeg-linux.zip
3+
ffmpeg-win32.zip
4+
ffmpeg-win64.zip
5+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
firefox-mac-10.14.zip
2+
firefox-ubuntu-18.04.zip
3+
firefox-win32.zip
4+
firefox-win64.zip

browser_patches/tools/check_cdn.sh

Lines changed: 0 additions & 164 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
webkit-ubuntu-18.04.zip
2+
webkit-ubuntu-20.04.zip
3+
webkit-mac-10.15.zip
4+
webkit-mac-11.0-arm64.zip
5+
webkit-win64.zip
6+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
winldd-win64.zip

0 commit comments

Comments
 (0)