summaryrefslogtreecommitdiffstats
path: root/interfacer/contrib/setup_firefox.sh
blob: ce3bd17c39d2e6d71dd44afef9ccd7a8cb95ba0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash

set -ex

if [ ! -f .travis.yml ]; then
  PROJECT_ROOT=$(git rev-parse --show-toplevel)
else
  PROJECT_ROOT=.
fi

line=$(grep 'firefox: "' < $PROJECT_ROOT/.travis.yml)
version=$(echo $line | grep -o '".*"' | cut -d " " -f 1 | sed 's/"//g')

# Firefox is needed both for testing in Travis and embedding in the Docker
# image used by the Browsh as a Service platform. So we need to be able to
# give a specific and consistent version pin.
FIREFOX_VERSION=$version

mkdir -p $HOME/bin
pushd $HOME/bin
curl -L -o firefox.tar.bz2 https://ftp.mozilla.org/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2
bzip2 -d firefox.tar.bz2
tar xf firefox.tar
popd

firefox --version