diff --git a/.gitlab/ci/gitlab.images.yml b/.gitlab/ci/gitlab.images.yml index 4180ab0..45f1ae1 100644 --- a/.gitlab/ci/gitlab.images.yml +++ b/.gitlab/ci/gitlab.images.yml @@ -16,7 +16,7 @@ gitlab: POSTGRESQL: ['11', '12', '13'] GOLANG: ['1.17', '1.18'] NODE: ['16.14'] - CHROME: ['94', '101'] + CHROME: ['99', '101'] # Used by GitLab's compile-production-assets and compile-test-assets jobs gitlab-assets: diff --git a/Dockerfile.custom b/Dockerfile.custom index 79e4ffe..90065f6 100644 --- a/Dockerfile.custom +++ b/Dockerfile.custom @@ -35,9 +35,8 @@ RUN if [ -n "$GIT_VERSION" ]; then /scripts/install-git && git --version; fi # Chrome ARG CHROME_VERSION -ARG CHROME_DRIVER_VERSION -RUN if [ -n "$CHROME_VERSION" ]; then /scripts/install-chrome $CHROME_VERSION $CHROME_DRIVER_VERSION && ( google-chrome --version || chromium --version ); fi +RUN if [ -n "$CHROME_VERSION" ]; then /scripts/install-chrome $CHROME_VERSION && ( google-chrome --version || chromium --version ); fi # NodeJS and Yarn ARG NODE_INSTALL_VERSION diff --git a/scripts/install-chrome b/scripts/install-chrome index a7135fb..a17c100 100755 --- a/scripts/install-chrome +++ b/scripts/install-chrome @@ -15,47 +15,48 @@ function build_debian() { fi CHROME_VERSION=${1:-99.0.4844.74-1} - CHROME_DRIVER_VERSION=${2:-99.0.4844.51} # We hard code the URL rather than using $CI_API_V4_URL $CI_PROJECT_ID, # because we would need to forward those variables CHROME_DOWNLOAD_URL_BASE="https://gitlab.com/api/v4/projects/1075790/packages/generic/google-chrome-stable" export DEBIAN_FRONTEND=noninteractive curl -sS -L https://dl.google.com/linux/linux_signing_key.pub | apt-key add - - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list + echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >/etc/apt/sources.list.d/google.list apt-get update -q -y -# Download from our package registry if we can't find the package in the apt repository -echo "Searching for $CHROME_VERSION in apt repository" -CHECK_VERSION=$(apt-cache show google-chrome-stable | grep Version | grep "$CHROME_VERSION") || true + # Download from our package registry if we can't find the package in the apt repository + echo "Searching for $CHROME_VERSION in apt repository" + CHECK_VERSION=$(apt-cache show google-chrome-stable | grep Version | grep "$CHROME_VERSION") || true -apt-cache policy google-chrome-stable + apt-cache policy google-chrome-stable -if [[ -z $CHECK_VERSION ]]; then - CHROME_DEB="google-chrome-stable_${CHROME_VERSION}_$(dpkg --print-architecture).deb" - CHROME_URL="${CHROME_DOWNLOAD_URL_BASE}/${CHROME_VERSION}/${CHROME_DEB}" - echo "Downloading from our Package registry: $CHROME_URL" - curl --silent --show-error --fail -O $CHROME_URL - dpkg -i ./$CHROME_DEB || true - apt-get install -f -y - rm -f $CHROME_DEB -else - echo "Installing via apt-get" - apt-get install -y google-chrome-stable=$CHROME_VERSION -fi + if [[ -z $CHECK_VERSION ]]; then + CHROME_DEB="google-chrome-stable_${CHROME_VERSION}_$(dpkg --print-architecture).deb" + CHROME_URL="${CHROME_DOWNLOAD_URL_BASE}/${CHROME_VERSION}/${CHROME_DEB}" + echo "Downloading from our Package registry: $CHROME_URL" + curl --silent --show-error --fail -O $CHROME_URL + dpkg -i ./$CHROME_DEB || true + apt-get install -f -y + rm -f $CHROME_DEB + else + echo "Installing via apt-get" + apt-get install -y google-chrome-stable=$CHROME_VERSION + fi -rm -rf /var/lib/apt/lists/* + rm -rf /var/lib/apt/lists/* -# Install ChromeDriver -wget -q https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -unzip chromedriver_linux64.zip -d /usr/local/bin -rm -f chromedriver_linux64.zip + # Install ChromeDriver + CHROME_VERSION_BASE=$(echo $CHROME_VERSION | awk -F "." '{print $1 "." $2 "." $3}') + CHROME_DRIVER_VERSION=$(curl -q https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION_BASE) + wget -q https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip + unzip chromedriver_linux64.zip -d /usr/local/bin + rm -f chromedriver_linux64.zip -apt-get autoremove -yq -apt-get clean -yqq -rm -rf /var/lib/apt/lists/* -rm -rf /etc/apt/sources.list.d/google*.list + apt-get autoremove -yq + apt-get clean -yqq + rm -rf /var/lib/apt/lists/* + rm -rf /etc/apt/sources.list.d/google*.list } BUILD_OS=${BUILD_OS:-debian} diff --git a/scripts/lib/custom-docker-build b/scripts/lib/custom-docker-build index 9162ba8..e045d4a 100755 --- a/scripts/lib/custom-docker-build +++ b/scripts/lib/custom-docker-build @@ -45,26 +45,18 @@ function print_golang_args() { # You may need to bump the version in scripts/install-chrome. function print_chrome_args() { case "$1" in - 94|94.0) - CHROME_VERSION=94.0.4606.81-1 - CHROME_DRIVER_VERSION=94.0.4606.113 - ;; - 97|97.0) - CHROME_VERSION=97.0.4692.99-1 - CHROME_DRIVER_VERSION=97.0.4692.71 - ;; 99|99.0) CHROME_VERSION=99.0.4844.74-1 - CHROME_DRIVER_VERSION=99.0.4844.51 ;; 101|101.0) CHROME_VERSION=101.0.4951.64-1 - CHROME_DRIVER_VERSION=101.0.4951.41 + ;; + 103|103.0) + CHROME_VERSION=103.0.5060.53-1 ;; *) echo "Unknown chrome version $1"; exit 1; esac printf -- "--build-arg CHROME_VERSION=%s " "$CHROME_VERSION" - printf -- "--build-arg CHROME_DRIVER_VERSION=%s " "$CHROME_DRIVER_VERSION" } # see https://www.kernel.org/pub/software/scm/git