Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix script for installing specific Chrome version with APT #92

Merged
merged 9 commits into from
Nov 27, 2024
10 changes: 5 additions & 5 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ workflows:
- int-test-all:
name: test-specific-version-all
executor: cimg-base
chrome-version: "114.0.5735.90"
chrome-version: "131.0.6778.85"
firefox-version: "90.0.1"
filters: *filters
- int-test-all:
Expand All @@ -122,7 +122,7 @@ workflows:
- int-test-chrome:
name: test-specific-version-chrome
executor: cimg-base
chrome-version: "92.0.4515.131"
chrome-version: "131.0.6778.85"
firefox-version: "90.0.1"
filters: *filters
- int-test-chrome:
Expand All @@ -143,7 +143,7 @@ workflows:
- int-test-firefox:
name: test-specific-version-firefox
executor: cimg-base
chrome-version: "92.0.4515.131"
chrome-version: "131.0.6778.85"
firefox-version: "90.0.1"
filters: *filters
- int-test-firefox:
Expand Down Expand Up @@ -205,7 +205,7 @@ executors:
- image: cimg/openjdk:11.0-browsers
macos:
macos:
xcode: 13.4.1
xcode: 15.3.0
linux:
machine:
image: ubuntu-2204:2022.04.2
image: ubuntu-2204:2024.08.1
3 changes: 2 additions & 1 deletion src/scripts/install-chrome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ else
if [[ "$ORB_PARAM_CHROME_VERSION" == "latest" ]]; then
ENV_IS_ARM=$(! dpkg --print-architecture | grep -q arm; echo $?)
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | $SUDO apt-key add -
if [ "$ENV_IS_ARM" == "arm" ]; then
if [ "$ENV_IS_ARM" == "arm" ]; then
echo "Installing Chrome for ARM64"
$SUDO sh -c 'echo "deb [arch=arm64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
else
Expand All @@ -119,6 +119,7 @@ else
DEBIAN_FRONTEND=noninteractive $SUDO apt-get install -y google-chrome-${ORB_PARAM_CHANNEL}
else
# Google does not keep older releases in their PPA, but they can be installed manually. HTTPS should be enough to secure the download.
$SUDO apt-get update
wget --no-verbose -O /tmp/chrome.deb "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${ORB_PARAM_CHROME_VERSION}-1_amd64.deb" \
&& $SUDO apt-get install -y /tmp/chrome.deb \
&& rm /tmp/chrome.deb
Expand Down
14 changes: 8 additions & 6 deletions src/scripts/install-chromedriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ if uname -a | grep Darwin >/dev/null 2>&1; then
else
CHROME_VERSION="$(/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version)"
fi

if uname -a | grep arm64 >/dev/null 2>&1; then
PLATFORM=mac-arm64
else
PLATFORM=mac-x64
fi


elif grep Alpine /etc/issue >/dev/null 2>&1; then
apk update >/dev/null 2>&1 &&
apk add --no-cache chromium-chromedriver >/dev/null
Expand Down Expand Up @@ -132,12 +134,12 @@ if [[ $CHROME_RELEASE -lt 70 ]]; then
exit 1
;;
esac
elif [[ $CHROME_RELEASE -lt 115 ]]; then
CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 3 \
"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEDRIVER_RELEASE")
else
# shellcheck disable=SC2001
CHROMEDRIVER_VERSION=$(echo $CHROME_VERSION | sed 's/[^0-9.]//g')
elif [[ $CHROME_RELEASE -lt 115 ]]; then
CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 3 \
"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEDRIVER_RELEASE")
else
# shellcheck disable=SC2001
CHROMEDRIVER_VERSION=$(echo $CHROME_VERSION | sed 's/[^0-9.]//g')
fi

# installation check
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/install-geckodriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ grab_geckodriver_version
installation_check

if uname -a | grep Darwin >>/dev/null 2>&1; then
PLATFORM=macos
PLATFORM=macos-aarch64
else
PLATFORM=linux64
fi
Expand Down