2
0

install-chrome.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. set -o pipefail -xeu
  3. if [ "${USE_CHROMIUM}" = 1 -o "${TARGETPLATFORM}" = "linux/arm64" ]; then
  4. echo "Using Debian's Chromium"
  5. apt-dpkg-wrap apt-get update
  6. apt-dpkg-wrap apt-get install -y chromium chromium-driver chromium-sandbox
  7. apt-cleanup
  8. chromium --version
  9. else
  10. if [ "${CHROME_RELEASE}" = "latest" ]; then
  11. wget -qO - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmour > /etc/apt/trusted.gpg.d/google.gpg
  12. echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
  13. apt-dpkg-wrap apt-get update
  14. apt-dpkg-wrap apt-get install -y google-chrome-stable
  15. apt-cleanup
  16. else
  17. curl -4so "/tmp/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb" "http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb"
  18. apt-dpkg-wrap apt-get update
  19. apt-dpkg-wrap apt-get install -y "/tmp/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb"
  20. apt-cleanup
  21. fi
  22. google-chrome --version
  23. if [ "${CHROMEDRIVER_MAJOR_RELEASE}" = "latest" ]; then
  24. CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE)"
  25. else
  26. CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROMEDRIVER_MAJOR_RELEASE})"
  27. fi
  28. curl -4Ls "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_RELEASE}/chromedriver_linux64.zip" | zcat >> /usr/bin/chromedriver
  29. chmod +x /usr/bin/chromedriver
  30. fi
  31. chromedriver --version