mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
Add Gecko webdriver to linux images
This commit is contained in:
@@ -23,3 +23,26 @@ echo "Lastly, documenting what we added to the metadata file"
|
|||||||
# ($HOME is /home/packer which is owned by packer.)
|
# ($HOME is /home/packer which is owned by packer.)
|
||||||
HOME=/root
|
HOME=/root
|
||||||
DocumentInstalledItem "Firefox ($(firefox --version))"
|
DocumentInstalledItem "Firefox ($(firefox --version))"
|
||||||
|
|
||||||
|
# Download and unpack latest release of geckodriver
|
||||||
|
URL=https:`curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest|grep 'browser_download_url.*linux64.tar.gz'|sed -e 's/^.*"https://'|sed -e 's/"//g'`
|
||||||
|
echo "Downloading geckodriver $URL..."
|
||||||
|
wget "$URL" -O geckodriver.tar.gz
|
||||||
|
tar -xzf geckodriver.tar.gz
|
||||||
|
rm geckodriver.tar.gz
|
||||||
|
|
||||||
|
GECKODRIVER_BIN="/usr/bin/geckodriver"
|
||||||
|
mv "geckodriver" $GECKODRIVER_BIN
|
||||||
|
chown root:root $GECKODRIVER_BIN
|
||||||
|
chmod +x $GECKODRIVER_BIN
|
||||||
|
echo "GECKOWEBDRIVER=$GECKODRIVER_BIN" | tee -a /etc/environment
|
||||||
|
|
||||||
|
# Run tests to determine that the geckodriver installed as expected
|
||||||
|
echo "Testing to make sure that script performed as expected, and basic scenarios work"
|
||||||
|
if ! command -v geckodriver; then
|
||||||
|
echo "geckodriver was not installed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Lastly, documenting what we added to the metadata file"
|
||||||
|
DocumentInstalledItem "Geckodriver ($(geckodriver --version)); Gecko Driver is available via GECKOWEBDRIVER environment variable"
|
||||||
|
|||||||
Reference in New Issue
Block a user