Merge branch 'acunskis-revert-chrome-install-changes' into 'master'

Update chrome installation and version

See merge request https://gitlab.com/gitlab-org/gitlab-build-images/-/merge_requests/597

Merged-by: Rémy Coutable <remy@rymai.me>
Approved-by: Rémy Coutable <remy@rymai.me>
Co-authored-by: Andrejs Cunskis <acunskis@gitlab.com>
This commit is contained in:
Rémy Coutable 2022-10-31 10:00:44 +00:00
commit 376bd5e17d
6 changed files with 35 additions and 31 deletions

View file

@ -4,7 +4,7 @@ customers:
- .build_and_push
variables:
LFS: '2.9'
CHROME: '106'
CHROME: '107'
NODE: '16.14'
YARN: '1.22'
POSTGRESQL: '10'
@ -19,7 +19,7 @@ customers-qa-assets:
extends:
- .build_and_push
variables:
CHROME: '106'
CHROME: '107'
NODE: '16.14'
YARN: '1.22'
DOCKER: '20.10.14'

View file

@ -23,7 +23,7 @@ e2e-chrome:
extends:
- e2e-docker
variables:
CHROME: '106'
CHROME: '107'
# Image used for running full e2e test suite
e2e-full:

View file

@ -17,7 +17,7 @@ gitlab:
POSTGRESQL: ['11', '12', '13']
GOLANG: ['1.18', '1.19']
NODE: ['16.14']
CHROME: ['105', '106']
CHROME: ['106', '107']
# Used by GitLab's compile-production-assets and compile-test-assets jobs
gitlab-assets:

View file

@ -5,7 +5,7 @@ gitlab-kas:
variables:
GOLANG: '1.19'
LFS: '2.9'
CHROME: '106'
CHROME: '107'
NODE: '14.15'
YARN: '1.22'
GRAPHICSMAGICK: '1.3.36'

View file

@ -3,27 +3,29 @@
set -xeuo pipefail
IFS=$'\n\t'
function build_debian() {
CHROME_VERSION=${1:-103.0.5060.134-1}
ARCH=${TARGETARCH:-amd64}
function download_deb() {
component=$1
if [ "${ARCH}" == "amd64" ]; then
PKG=google-chrome-stable
if [ "${component}" == "browser" ]; then
local DEB="${PKG}_${CHROME_VERSION}_${ARCH}.deb"
else
# TODO: We do not yet have all packages required for platform other than amd64
apt install -y chromium chromium-driver
return
local DEB="${PKG}-${component}_${CHROME_VERSION}_${ARCH}.deb"
fi
# We hard code the URL rather than using $CI_API_V4_URL $CI_PROJECT_ID,
# because we would need to forward those variables
DOWNLOAD_URL_BASE="https://gitlab.com/api/v4/projects/1075790/packages/generic/${PKG}"
BROWSER_DEB="${PKG}_${CHROME_VERSION}_${ARCH}.deb"
BROWSER_URL="${DOWNLOAD_URL_BASE}/${CHROME_VERSION}/${BROWSER_DEB}"
curl --silent --show-error --fail -O "${DOWNLOAD_URL_BASE}/${CHROME_VERSION}/$DEB"
echo "${DEB}"
}
function build_debian() {
echo "Installing browser"
curl --silent --show-error --fail -O "$BROWSER_URL"
apt install -y "$PWD/$BROWSER_DEB"
BROWSER_DEB="$(download_deb browser)"
if [ "${ARCH}" == "arm64" ]; then
COMMON_DEB=$(download_deb common)
apt install -y "$PWD/${COMMON_DEB}" "$PWD/${BROWSER_DEB}"
rm -rf "$COMMON_DEB"
else
apt install -y "$PWD/${BROWSER_DEB}"
fi
rm -f "$BROWSER_DEB"
echo "Installing webdriver"
@ -35,10 +37,7 @@ function build_debian() {
unzip chromedriver_linux64.zip -d /usr/local/bin
rm -f chromedriver_linux64.zip
else
DRIVER_DEB="${PKG}-driver_${CHROME_VERSION}_${ARCH}.deb"
DRIVER_URL="${DOWNLOAD_URL_BASE}/${CHROME_VERSION}/${DRIVER_DEB}"
curl --silent --show-error --fail -O "$DRIVER_URL"
DRIVER_DEB=$(download_deb driver)
apt install -y "$PWD/$DRIVER_DEB"
rm -f "$DRIVER_DEB"
fi
@ -50,6 +49,14 @@ function build_debian() {
}
BUILD_OS=${BUILD_OS:-debian}
CHROME_VERSION=${1:-107.0.5304.87-1}
ARCH=${TARGETARCH:-amd64}
if [ "${ARCH}" == "amd64" ]; then
PKG=google-chrome-stable
else
PKG=chromium
fi
DOWNLOAD_URL_BASE="https://gitlab.com/api/v4/projects/1075790/packages/generic/${PKG}"
if [[ $BUILD_OS =~ debian ]]; then
build_debian "$@"

View file

@ -64,14 +64,11 @@ function print_golang_args() {
# You may need to bump the version in scripts/install-chrome.
function print_chrome_args() {
case "$1" in
104|104.0)
CHROME_VERSION=104.0.5112.101-1
;;
105|105.0)
CHROME_VERSION=105.0.5195.125-1
;;
106|106.0)
CHROME_VERSION=106.0.5249.91-1
CHROME_VERSION=106.0.5249.119-1
;;
107|107.0)
CHROME_VERSION=107.0.5304.87-1
;;
*) fail "Unknown chrome version $1" ;;
esac