discourse_docker/image/discourse_dev/install-selenium

26 lines
904 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -e
# The Selenium gem isnt shipped with the `selenium-manager` binary for aarch64
# (yet). So we have to compile it ourselves.
if [ "$(dpkg --print-architecture)" = "arm64" ]; then
apt update && apt install -y firefox-esr chromium-driver
cd /tmp
/tmp/install-rust
git clone --depth 1 --no-checkout https://github.com/SeleniumHQ/selenium.git
cd selenium
git sparse-checkout set rust
git checkout
cd rust
cargo build --release
cp target/release/selenium-manager /usr/local/bin
rustup self uninstall -y
cd /
rm -rf /tmp/*
else
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - &&\
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list &&\
apt update &&\
apt install -y google-chrome-stable firefox-esr chromium-driver
fi