mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
37 lines
1.1 KiB
Bash
Executable File
37 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
IFS=$'\n\t'
|
|
|
|
echo "Installing requirements"
|
|
sudo apt-get install -yq --no-install-recommends \
|
|
python3-pytest python3-pytest-django \
|
|
python3-pip firefox smbclient\
|
|
xvfb
|
|
pip3 install wheel
|
|
pip3 install splinter pytest-splinter pytest-bdd pytest-xvfb
|
|
|
|
echo "Installing geckodriver"
|
|
(
|
|
DL_DIR=/tmp/gecko
|
|
GECKO_VERSION=$(curl --silent "https://api.github.com/repos/mozilla/geckodriver/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
|
|
FILENAME="geckodriver-${GECKO_VERSION}-linux64.tar.gz"
|
|
GECKO_URL="https://github.com/mozilla/geckodriver/releases/download/$GECKO_VERSION/$FILENAME"
|
|
|
|
test -e /usr/local/bin/geckodriver && \
|
|
test "$GECKO_VERSION" = "v$(geckodriver --version | head -1 | awk '{ print $2 }')" && \
|
|
echo "geckodriver already installed" && \
|
|
exit 0
|
|
|
|
mkdir -p $DL_DIR
|
|
cd $DL_DIR
|
|
if ! [[ -e $FILENAME ]] ; then
|
|
wget --no-clobber \
|
|
--continue \
|
|
--no-verbose \
|
|
"$GECKO_URL"
|
|
fi
|
|
tar xf $FILENAME
|
|
sudo mv geckodriver /usr/local/bin/geckodriver
|
|
echo "Done"
|
|
)
|