#!/bin/bash
# Sets up phantomjs.

# Stop on errors
set -e

PHANTOMJS_VERSION="2.1.1"

cd /usr/src/app/
mkdir -p build && cd build

curl -LSO https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
tar -xjf phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
mv phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
/usr/bin/phantomjs -v