From d5fb264b8c1bc3e337c1d86b225e65a02a616df0 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Sat, 11 Jan 2020 02:30:35 +0100 Subject: [PATCH] devops: remove `--win64` flag from checkout_build_archive_upload.sh Both `checkout_build_archive_upload.sh` and `upload.sh` scripts now accept a `firefox-win64` browser instead of an optional `--win64` flag. This is a preparation before introducing `webkit-wpe` parameter in these scripts. --- browser_patches/buildbots/buildbot-windows.sh | 2 +- .../checkout_build_archive_upload.sh | 18 +++++++------- browser_patches/upload.sh | 24 +++++++++++-------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/browser_patches/buildbots/buildbot-windows.sh b/browser_patches/buildbots/buildbot-windows.sh index e2224a9d91..b01529d809 100755 --- a/browser_patches/buildbots/buildbot-windows.sh +++ b/browser_patches/buildbots/buildbot-windows.sh @@ -47,7 +47,7 @@ while true; do git pull origin master ../checkout_build_archive_upload.sh firefox || true git pull origin master - ../checkout_build_archive_upload.sh firefox --win64 || true + ../checkout_build_archive_upload.sh firefox-win64 || true newTimestamp=$(date +%s) delta=$(( 300 - newTimestamp + timestamp )); if (( delta > 0 )); then diff --git a/browser_patches/checkout_build_archive_upload.sh b/browser_patches/checkout_build_archive_upload.sh index 6e38046da2..be2aff386b 100755 --- a/browser_patches/checkout_build_archive_upload.sh +++ b/browser_patches/checkout_build_archive_upload.sh @@ -3,7 +3,7 @@ set -e set +x if [[ ($1 == '--help') || ($1 == '-h') ]]; then - echo "usage: $(basename $0) [firefox|webkit] [-f|--force]" + echo "usage: $(basename $0) [firefox|firefox-win64|webkit] [-f|--force]" echo echo "Prepares checkout under browser folder, applies patches, builds, archives, and uploades if build is missing." echo "Script will bail out early if the build for the browser version is already present." @@ -21,12 +21,12 @@ if [[ $# == 0 ]]; then fi BROWSER_NAME="" -FFOX_WIN64="" +EXTRA_BUILD_ARGS="" if [[ ("$1" == "firefox") || ("$1" == "firefox/") ]]; then BROWSER_NAME="firefox" - if [[ ("$2" == "--win64") || ("$3" == "--win64") ]]; then - FFOX_WIN64="--win64" - fi +elif [[ ("$1" == "firefox-win64") || ("$1" == "firefox-win64/") ]]; then + BROWSER_NAME="firefox" + EXTRA_BUILD_ARGS="--win64" elif [[ ("$1" == "webkit") || ("$1" == "webkit/") ]]; then BROWSER_NAME="webkit" else @@ -50,7 +50,7 @@ BUILD_NUMBER=$(cat ./$BROWSER_NAME/BUILD_NUMBER) # pull from upstream and check if a new build has to be uploaded. if ! [[ ($2 == '-f') || ($2 == '--force') ]]; then - if ./upload.sh $BROWSER_NAME --check $FFOX_WIN64; then + if ./upload.sh $1 --check; then echo "Build is already uploaded - no changes." exit 0 else @@ -69,7 +69,7 @@ cd - source ./buildbots/send_telegram_message.sh LAST_COMMIT_MESSAGE=$(git log --format=%s -n 1 HEAD -- ./$BROWSER_NAME/BUILD_NUMBER) -BUILD_ALIAS="[[$(./upload.sh $BROWSER_NAME --show-alias $FFOX_WIN64)]] $LAST_COMMIT_MESSAGE" +BUILD_ALIAS="[[$(./upload.sh $1 --show-alias)]] $LAST_COMMIT_MESSAGE" send_telegram_message "$BUILD_ALIAS -- started ⏳" echo "-- preparing checkout" @@ -85,7 +85,7 @@ if ! ./$BROWSER_NAME/clean.sh; then fi echo "-- building" -if ! ./$BROWSER_NAME/build.sh $FFOX_WIN64; then +if ! ./$BROWSER_NAME/build.sh "$EXTRA_BUILD_ARGS"; then send_telegram_message "$BUILD_ALIAS -- ./build.sh failed! ❌" exit 1 fi @@ -97,7 +97,7 @@ if ! ./$BROWSER_NAME/archive.sh $ZIP_PATH; then fi echo "-- uploading" -if ! ./upload.sh $BROWSER_NAME $ZIP_PATH $FFOX_WIN64; then +if ! ./upload.sh $1 $ZIP_PATH; then send_telegram_message "$BUILD_ALIAS -- ./upload.sh failed! ❌" exit 1 fi diff --git a/browser_patches/upload.sh b/browser_patches/upload.sh index bcf1f306f9..4ce88fad8a 100755 --- a/browser_patches/upload.sh +++ b/browser_patches/upload.sh @@ -6,7 +6,7 @@ trap "cd $(pwd -P)" EXIT cd "$(dirname "$0")" if [[ ($1 == '--help') || ($1 == '-h') ]]; then - echo "usage: $(basename $0) [firefox|webkit] [--check] [zip-path] [--win64]" + echo "usage: $(basename $0) [firefox|firefox-win64|webkit] [--check] [zip-path]" echo echo "Upload .zip as a browser build." echo @@ -34,6 +34,7 @@ BROWSER_NAME="" BUILD_NUMBER="" BLOB_NAME="" ALIAS="" + if [[ ("$1" == "firefox") || ("$1" == "firefox/") ]]; then # we always apply our patches atop of beta since it seems to get better # reliability guarantees. @@ -46,15 +47,18 @@ if [[ ("$1" == "firefox") || ("$1" == "firefox/") ]]; then BLOB_NAME="firefox-linux.zip" ALIAS="ff-linux r$BUILD_NUMBER" elif [[ "$(uname)" == MINGW* ]]; then - if [[ ("$2" == "--win64") || ("$3" == "--win64") ]]; then - BLOB_NAME="firefox-win64.zip" - ALIAS="ff-win64 r$BUILD_NUMBER" - else - BLOB_NAME="firefox-win32.zip" - ALIAS="ff-win32 r$BUILD_NUMBER" - fi + BLOB_NAME="firefox-win32.zip" + ALIAS="ff-win32 r$BUILD_NUMBER" else - echo "ERROR: unzupported platform - $(uname)" + echo "ERROR: unsupported platform - $(uname)" + exit 1 + fi +elif [[ ("$1" == "firefox-win64") || ("$1" == "firefox-win64/") ]]; then + if [[ "$(uname)" == MINGW* ]]; then + BLOB_NAME="firefox-win64.zip" + ALIAS="ff-win64 r$BUILD_NUMBER" + else + echo "ERROR: unsupported platform for browser '$1' - $(uname)" exit 1 fi elif [[ ("$1" == "webkit") || ("$1" == "webkit/") ]]; then @@ -68,7 +72,7 @@ elif [[ ("$1" == "webkit") || ("$1" == "webkit/") ]]; then BLOB_NAME="minibrowser-linux.zip" ALIAS="webkit-linux r$BUILD_NUMBER" else - echo "ERROR: unzupported platform - $(uname)" + echo "ERROR: unsupported platform - $(uname)" exit 1 fi else