2020-08-08 02:22:05 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set +x
|
|
|
|
|
|
|
|
trap "cd $(pwd -P)" EXIT
|
|
|
|
cd "$(dirname $0)"
|
|
|
|
|
2020-09-04 12:18:36 +03:00
|
|
|
rm -rf output
|
2020-08-08 02:22:05 +03:00
|
|
|
mkdir -p output
|
|
|
|
cd output
|
|
|
|
|
2020-09-09 03:05:21 +03:00
|
|
|
CRREV=$(head -1 ../BUILD_NUMBER)
|
2020-09-04 12:18:36 +03:00
|
|
|
|
|
|
|
CHROMIUM_URL=""
|
|
|
|
CHROMIUM_FOLDER_NAME=""
|
|
|
|
CHROMIUM_FILES_TO_REMOVE=()
|
|
|
|
|
2020-09-04 14:23:13 +03:00
|
|
|
PLATFORM="$1"
|
|
|
|
if [[ -z "${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
|
|
|
|
|
|
|
|
if [[ "${PLATFORM}" == "--win32" ]]; then
|
devops: encode build number together with Chromium revision (#3769)
This is an alternative approach to #3698 that was setting up a custom
mapping between chromium revisions and our mirrored builds. For example, we were
taking chromium `792639` and re-packaging it to our CDN as Chromium 1000.
One big downside of this opaque mapping was inability to quickly
understand which Chromium is mirrored to CDN.
To solve this, this patch starts treating browser revision as a fractional number,
with and integer part being a chromium revision, and fractional
part being our build number. For example, we can generate builds `792639`, `792639.1`,
`792639.2` etc, all of which will pick Chromium `792639` and re-package it to our CDN.
In the Playwright code itself, there are a handful of places that treat
browser revision as integer, exclusively to compare revision with some particular
revision numbers. This code would still work as-is, but I changed these places
to use `parseFloat` instead of `parseInt` for correctness.
2020-09-04 13:12:30 +03:00
|
|
|
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Win/${CRREV}/chrome-win.zip"
|
2020-09-04 12:18:36 +03:00
|
|
|
CHROMIUM_FOLDER_NAME="chrome-win"
|
|
|
|
CHROMIUM_FILES_TO_REMOVE+=("chrome-win/interactive_ui_tests.exe")
|
2020-09-04 14:23:13 +03:00
|
|
|
elif [[ "${PLATFORM}" == "--win64" ]]; then
|
devops: encode build number together with Chromium revision (#3769)
This is an alternative approach to #3698 that was setting up a custom
mapping between chromium revisions and our mirrored builds. For example, we were
taking chromium `792639` and re-packaging it to our CDN as Chromium 1000.
One big downside of this opaque mapping was inability to quickly
understand which Chromium is mirrored to CDN.
To solve this, this patch starts treating browser revision as a fractional number,
with and integer part being a chromium revision, and fractional
part being our build number. For example, we can generate builds `792639`, `792639.1`,
`792639.2` etc, all of which will pick Chromium `792639` and re-package it to our CDN.
In the Playwright code itself, there are a handful of places that treat
browser revision as integer, exclusively to compare revision with some particular
revision numbers. This code would still work as-is, but I changed these places
to use `parseFloat` instead of `parseInt` for correctness.
2020-09-04 13:12:30 +03:00
|
|
|
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/${CRREV}/chrome-win.zip"
|
2020-09-04 12:18:36 +03:00
|
|
|
CHROMIUM_FOLDER_NAME="chrome-win"
|
|
|
|
CHROMIUM_FILES_TO_REMOVE+=("chrome-win/interactive_ui_tests.exe")
|
2020-09-04 14:23:13 +03:00
|
|
|
elif [[ "${PLATFORM}" == "--mac" ]]; then
|
devops: encode build number together with Chromium revision (#3769)
This is an alternative approach to #3698 that was setting up a custom
mapping between chromium revisions and our mirrored builds. For example, we were
taking chromium `792639` and re-packaging it to our CDN as Chromium 1000.
One big downside of this opaque mapping was inability to quickly
understand which Chromium is mirrored to CDN.
To solve this, this patch starts treating browser revision as a fractional number,
with and integer part being a chromium revision, and fractional
part being our build number. For example, we can generate builds `792639`, `792639.1`,
`792639.2` etc, all of which will pick Chromium `792639` and re-package it to our CDN.
In the Playwright code itself, there are a handful of places that treat
browser revision as integer, exclusively to compare revision with some particular
revision numbers. This code would still work as-is, but I changed these places
to use `parseFloat` instead of `parseInt` for correctness.
2020-09-04 13:12:30 +03:00
|
|
|
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Mac/${CRREV}/chrome-mac.zip"
|
2020-09-04 12:18:36 +03:00
|
|
|
CHROMIUM_FOLDER_NAME="chrome-mac"
|
2020-09-04 14:23:13 +03:00
|
|
|
elif [[ "${PLATFORM}" == "--linux" ]]; then
|
devops: encode build number together with Chromium revision (#3769)
This is an alternative approach to #3698 that was setting up a custom
mapping between chromium revisions and our mirrored builds. For example, we were
taking chromium `792639` and re-packaging it to our CDN as Chromium 1000.
One big downside of this opaque mapping was inability to quickly
understand which Chromium is mirrored to CDN.
To solve this, this patch starts treating browser revision as a fractional number,
with and integer part being a chromium revision, and fractional
part being our build number. For example, we can generate builds `792639`, `792639.1`,
`792639.2` etc, all of which will pick Chromium `792639` and re-package it to our CDN.
In the Playwright code itself, there are a handful of places that treat
browser revision as integer, exclusively to compare revision with some particular
revision numbers. This code would still work as-is, but I changed these places
to use `parseFloat` instead of `parseInt` for correctness.
2020-09-04 13:12:30 +03:00
|
|
|
CHROMIUM_URL="https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CRREV}/chrome-linux.zip"
|
2020-09-04 12:18:36 +03:00
|
|
|
CHROMIUM_FOLDER_NAME="chrome-linux"
|
2020-08-08 02:22:05 +03:00
|
|
|
else
|
|
|
|
echo "ERROR: unknown platform to build: $1"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-09-04 14:23:13 +03:00
|
|
|
echo "--> Pulling Chromium ${CRREV} for ${PLATFORM#--}"
|
|
|
|
|
2020-09-04 12:18:36 +03:00
|
|
|
curl --output chromium-upstream.zip "${CHROMIUM_URL}"
|
|
|
|
unzip chromium-upstream.zip
|
|
|
|
for file in ${CHROMIUM_FILES_TO_REMOVE[@]}; do
|
2020-08-11 01:00:37 +03:00
|
|
|
rm -f "${file}"
|
|
|
|
done
|
2020-08-08 02:22:05 +03:00
|
|
|
|
2020-09-04 12:18:36 +03:00
|
|
|
zip --symlinks -r build.zip "${CHROMIUM_FOLDER_NAME}"
|