mirror of
https://github.com/microsoft/playwright.git
synced 2025-01-07 03:39:48 +03:00
chore: split out Chromium mirroring to a separate script (#10399)
#10398
This commit is contained in:
parent
0781d0303b
commit
51f714f235
@ -165,33 +165,6 @@ elif [[ "$BUILD_FLAVOR" == "chromium-with-symbols-linux-arm64" ]]; then
|
|||||||
BUILD_BLOB_NAME="chromium-with-symbols-linux-arm64.zip"
|
BUILD_BLOB_NAME="chromium-with-symbols-linux-arm64.zip"
|
||||||
BUILDS_LIST="EXPECTED_BUILDS_WITH_SYMBOLS"
|
BUILDS_LIST="EXPECTED_BUILDS_WITH_SYMBOLS"
|
||||||
|
|
||||||
|
|
||||||
# ===========================
|
|
||||||
# CHROMIUM MIRRORING
|
|
||||||
# ===========================
|
|
||||||
elif [[ "$BUILD_FLAVOR" == "chromium-linux-mirror-to-cdn" ]]; then
|
|
||||||
BROWSER_NAME="chromium"
|
|
||||||
EXTRA_BUILD_ARGS="--mirror-linux"
|
|
||||||
EXTRA_ARCHIVE_ARGS="--mirror-linux"
|
|
||||||
EXPECTED_HOST_OS="Ubuntu"
|
|
||||||
EXPECTED_HOST_OS_VERSION="18.04"
|
|
||||||
BUILD_BLOB_NAME="chromium-linux.zip"
|
|
||||||
elif [[ "$BUILD_FLAVOR" == "chromium-mac-mirror-to-cdn" ]]; then
|
|
||||||
BROWSER_NAME="chromium"
|
|
||||||
EXTRA_BUILD_ARGS="--mirror-mac"
|
|
||||||
EXTRA_ARCHIVE_ARGS="--mirror-mac"
|
|
||||||
EXPECTED_HOST_OS="Ubuntu"
|
|
||||||
EXPECTED_HOST_OS_VERSION="18.04"
|
|
||||||
BUILD_BLOB_NAME="chromium-mac.zip"
|
|
||||||
elif [[ "$BUILD_FLAVOR" == "chromium-win64-mirror-to-cdn" ]]; then
|
|
||||||
BROWSER_NAME="chromium"
|
|
||||||
EXTRA_BUILD_ARGS="--mirror-win64"
|
|
||||||
EXTRA_ARCHIVE_ARGS="--mirror-win64"
|
|
||||||
EXPECTED_HOST_OS="Ubuntu"
|
|
||||||
EXPECTED_HOST_OS_VERSION="18.04"
|
|
||||||
BUILD_BLOB_NAME="chromium-win64.zip"
|
|
||||||
|
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# FIREFOX COMPILATION
|
# FIREFOX COMPILATION
|
||||||
# ===========================
|
# ===========================
|
||||||
|
@ -6,9 +6,9 @@ trap "cd $(pwd -P)" EXIT
|
|||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
USAGE=$(cat<<EOF
|
USAGE=$(cat<<EOF
|
||||||
usage: $(basename "$0") [--mirror|--mirror-linux|--mirror-win64|--mirror-mac|--compile-mac-arm64|--compile-linux|--compile-linux-arm64|--compile-win64|--compile-mac] [--symbols] [--full]
|
usage: $(basename "$0") [--compile-mac-arm64|--compile-linux|--compile-linux-arm64|--compile-win64|--compile-mac] [--symbols] [--full]
|
||||||
|
|
||||||
Either compiles chromium or mirrors it from Chromium Continuous Builds CDN.
|
Compiles chromium.
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,8 +19,6 @@ main() {
|
|||||||
if [[ $1 == "--help" || $1 == "-h" ]]; then
|
if [[ $1 == "--help" || $1 == "-h" ]]; then
|
||||||
echo "$USAGE"
|
echo "$USAGE"
|
||||||
exit 0
|
exit 0
|
||||||
elif [[ $1 == "--mirror"* ]]; then
|
|
||||||
mirror_chromium "$1"
|
|
||||||
elif [[ $1 == "--compile"* ]]; then
|
elif [[ $1 == "--compile"* ]]; then
|
||||||
compile_chromium "$1" "$2" "$3"
|
compile_chromium "$1" "$2" "$3"
|
||||||
else
|
else
|
||||||
@ -115,45 +113,4 @@ compile_chromium() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
mirror_chromium() {
|
|
||||||
cd "$SCRIPT_FOLDER"
|
|
||||||
rm -rf output
|
|
||||||
mkdir -p output
|
|
||||||
cd output
|
|
||||||
|
|
||||||
CHROMIUM_URL=""
|
|
||||||
|
|
||||||
PLATFORM="$1"
|
|
||||||
if [[ "${PLATFORM}" == "--mirror" ]]; then
|
|
||||||
CURRENT_HOST_OS="$(uname)"
|
|
||||||
if [[ "${CURRENT_HOST_OS}" == "Darwin" ]]; then
|
|
||||||
PLATFORM="--mirror-mac"
|
|
||||||
elif [[ "${CURRENT_HOST_OS}" == "Linux" ]]; then
|
|
||||||
PLATFORM="--mirror-linux"
|
|
||||||
elif [[ "${CURRENT_HOST_OS}" == MINGW* ]]; then
|
|
||||||
PLATFORM="--mirror-win64"
|
|
||||||
else
|
|
||||||
echo "ERROR: unsupported host platform - ${CURRENT_HOST_OS}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
CRREV=$(head -1 "${SCRIPT_FOLDER}/BUILD_NUMBER")
|
|
||||||
if [[ "${PLATFORM}" == "--mirror-win64" ]]; then
|
|
||||||
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/${CRREV}/chrome-win.zip"
|
|
||||||
elif [[ "${PLATFORM}" == "--mirror-mac" ]]; then
|
|
||||||
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Mac/${CRREV}/chrome-mac.zip"
|
|
||||||
elif [[ "${PLATFORM}" == "--mirror-linux" ]]; then
|
|
||||||
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CRREV}/chrome-linux.zip"
|
|
||||||
else
|
|
||||||
echo "ERROR: unknown platform to build: $1"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "--> Pulling Chromium ${CRREV} for ${PLATFORM#--}"
|
|
||||||
|
|
||||||
curl --output chromium-upstream.zip "${CHROMIUM_URL}"
|
|
||||||
unzip chromium-upstream.zip
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$1" "$2" "$3"
|
main "$1" "$2" "$3"
|
||||||
|
68
browser_patches/chromium/mirror.sh
Executable file
68
browser_patches/chromium/mirror.sh
Executable file
@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
set +x
|
||||||
|
|
||||||
|
trap "cd $(pwd -P)" EXIT
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
USAGE=$(cat<<EOF
|
||||||
|
usage: $(basename "$0") [--linux|--win64|--mac]
|
||||||
|
|
||||||
|
Mirrors Chromium from Chromium Continuous Builds CDN.
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
SCRIPT_FOLDER=$(pwd -P)
|
||||||
|
source "${SCRIPT_FOLDER}/../utils.sh"
|
||||||
|
|
||||||
|
main() {
|
||||||
|
if [[ $1 == "--help" || $1 == "-h" ]]; then
|
||||||
|
echo "$USAGE"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
mirror_chromium "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mirror_chromium() {
|
||||||
|
cd "$SCRIPT_FOLDER"
|
||||||
|
rm -rf output
|
||||||
|
mkdir -p output
|
||||||
|
cd output
|
||||||
|
|
||||||
|
CHROMIUM_URL=""
|
||||||
|
|
||||||
|
PLATFORM="$1"
|
||||||
|
if [[ -n "${PLATFORM}" ]]; then
|
||||||
|
CURRENT_HOST_OS="$(uname)"
|
||||||
|
if [[ "${CURRENT_HOST_OS}" == "Darwin" ]]; then
|
||||||
|
PLATFORM="--mac"
|
||||||
|
elif [[ "${CURRENT_HOST_OS}" == "Linux" ]]; then
|
||||||
|
PLATFORM="--linux"
|
||||||
|
elif [[ "${CURRENT_HOST_OS}" == MINGW* ]]; then
|
||||||
|
PLATFORM="--win64"
|
||||||
|
else
|
||||||
|
echo "ERROR: unsupported host platform - ${CURRENT_HOST_OS}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
CRREV=$(head -1 "${SCRIPT_FOLDER}/BUILD_NUMBER")
|
||||||
|
if [[ "${PLATFORM}" == "--win64" ]]; then
|
||||||
|
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/${CRREV}/chrome-win.zip"
|
||||||
|
elif [[ "${PLATFORM}" == "--mac" ]]; then
|
||||||
|
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Mac/${CRREV}/chrome-mac.zip"
|
||||||
|
elif [[ "${PLATFORM}" == "--linux" ]]; then
|
||||||
|
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CRREV}/chrome-linux.zip"
|
||||||
|
else
|
||||||
|
echo "ERROR: unknown platform to build: $1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "--> Pulling Chromium ${CRREV} for ${PLATFORM#--}"
|
||||||
|
|
||||||
|
curl --output chromium-upstream.zip "${CHROMIUM_URL}"
|
||||||
|
unzip chromium-upstream.zip
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$1" "$2" "$3"
|
Loading…
Reference in New Issue
Block a user