Skip to content

Commit

Permalink
Update chromedriver fetch process
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Dec 7, 2023
1 parent b69f618 commit 0e2c1a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
19 changes: 14 additions & 5 deletions bin/chrome_setup.bash
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/bin/bash

VERSION=$( curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$( google-chrome --version | awk '{print $NF}' | cut -d. -f1,2,3 ) )
wget -q https://chromedriver.storage.googleapis.com/${VERSION}/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
mv chromedriver /usr/bin/chromedriver

DOWNLOAD_URL=$(
wget -qO- https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json |
jq -r '.versions[] |
select(.version == "'$(google-chrome --version | awk '{print $NF}' | cut -d. -f1,2,3,4 )'") |
.downloads.chromedriver[] |
select(.platform == "linux64") |
.url'
)

wget -q "$DOWNLOAD_URL"
unzip chromedriver-linux64.zip
mv chromedriver-linux64/chromedriver /usr/bin/chromedriver
chown root:root /usr/bin/chromedriver
chmod +x /usr/bin/chromedriver
rm -f chromedriver_linux64.zip
rm -f chromedriver-linux64.zip
19 changes: 14 additions & 5 deletions bin/docker-provision
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,19 @@ xargs apt-get install -qq -y < /install/packages
cd /install/
# get and setup get chromedriver

VERSION=$( curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$( google-chrome --version | awk '{print $NF}' | cut -d. -f1,2,3 ) )
wget -q https://chromedriver.storage.googleapis.com/${VERSION}/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
mv chromedriver /usr/bin/chromedriver

DOWNLOAD_URL=$(
wget -qO- https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json |
jq -r '.versions[] |
select(.version == "'$(google-chrome --version | awk '{print $NF}' | cut -d. -f1,2,3,4 )'") |
.downloads.chromedriver[] |
select(.platform == "linux64") |
.url'
)

wget -q "$DOWNLOAD_URL"
unzip chromedriver-linux64.zip
mv chromedriver-linux64/chromedriver /usr/bin/chromedriver
chown root:root /usr/bin/chromedriver
chmod +x /usr/bin/chromedriver
rm -f chromedriver_linux64.zip
rm -f chromedriver-linux64.zip
3 changes: 2 additions & 1 deletion script/config/packages
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ unzip
zip
libxi6
libgconf-2-4
google-chrome-stable
google-chrome-stable
jq

0 comments on commit 0e2c1a2

Please sign in to comment.