2
0

install-chrome.sh 1.2 KB

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. set -o pipefail -xeu
  3. if [ "${CHROME_RELEASE}" = "latest" ]; then
  4. wget -qO - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmour > /etc/apt/trusted.gpg.d/google.gpg
  5. echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
  6. apt-dpkg-wrap apt-get update
  7. apt-dpkg-wrap apt-get install -y google-chrome-stable
  8. apt-cleanup
  9. else
  10. 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"
  11. apt-dpkg-wrap apt-get update
  12. apt-dpkg-wrap apt-get install -y "/tmp/google-chrome-stable_${CHROME_RELEASE}-1_amd64.deb"
  13. apt-cleanup
  14. fi
  15. if [ "${CHROMEDRIVER_MAJOR_RELEASE}" = "latest" ]; then
  16. CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE)"
  17. else
  18. CHROMEDRIVER_RELEASE="$(curl -4Ls https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROMEDRIVER_MAJOR_RELEASE})"
  19. fi
  20. curl -4Ls "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_RELEASE}/chromedriver_linux64.zip" | zcat >> /usr/bin/chromedriver
  21. chmod +x /usr/bin/chromedriver
  22. chromedriver --version