From 22154087ee4cd2934954f5885e8495a6a2eef558 Mon Sep 17 00:00:00 2001 From: Andrejs Cunskis Date: Sun, 30 Oct 2022 19:40:10 +0200 Subject: [PATCH] Update chrome installation and version --- .gitlab/ci/customers.images.yml | 4 +-- .gitlab/ci/e2e.images.yml | 2 +- .gitlab/ci/gitlab.images.yml | 2 +- .gitlab/ci/kas.images.yml | 2 +- scripts/install-chrome | 45 +++++++++++++++++++-------------- scripts/lib/custom-docker-build | 11 +++----- 6 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.gitlab/ci/customers.images.yml b/.gitlab/ci/customers.images.yml index c2ef62d..e4520b5 100644 --- a/.gitlab/ci/customers.images.yml +++ b/.gitlab/ci/customers.images.yml @@ -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' diff --git a/.gitlab/ci/e2e.images.yml b/.gitlab/ci/e2e.images.yml index 1d9ba71..ecf3678 100644 --- a/.gitlab/ci/e2e.images.yml +++ b/.gitlab/ci/e2e.images.yml @@ -23,7 +23,7 @@ e2e-chrome: extends: - e2e-docker variables: - CHROME: '106' + CHROME: '107' # Image used for running full e2e test suite e2e-full: diff --git a/.gitlab/ci/gitlab.images.yml b/.gitlab/ci/gitlab.images.yml index b3ec1ae..6deb90b 100644 --- a/.gitlab/ci/gitlab.images.yml +++ b/.gitlab/ci/gitlab.images.yml @@ -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: diff --git a/.gitlab/ci/kas.images.yml b/.gitlab/ci/kas.images.yml index 3781046..89142b4 100644 --- a/.gitlab/ci/kas.images.yml +++ b/.gitlab/ci/kas.images.yml @@ -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' diff --git a/scripts/install-chrome b/scripts/install-chrome index efb5f88..357ac94 100755 --- a/scripts/install-chrome +++ b/scripts/install-chrome @@ -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 "$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 "$@" diff --git a/scripts/lib/custom-docker-build b/scripts/lib/custom-docker-build index 1d1bcb3..ccf9678 100755 --- a/scripts/lib/custom-docker-build +++ b/scripts/lib/custom-docker-build @@ -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