Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nkconnor/503d8515d5b57b450c214bcdb5a409be to your computer and use it in GitHub Desktop.
Save nkconnor/503d8515d5b57b450c214bcdb5a409be to your computer and use it in GitHub Desktop.
AWS EB-Extension to install PhantomJS
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/04_install_phantomjs":
mode: "000777"
owner: root
group: root
content: |
#!/usr/bin/env bash
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
. $EB_SUPPORT_DIR/envvars
command -v phantomjs >/dev/null 2>&1 || {
echo "PhantomJS needs to be installed now";
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
mkdir -p /opt/phantomjs
bzip2 -d phantomjs-1.9.8-linux-x86_64.tar.bz2
tar -xvf phantomjs-1.9.8-linux-x86_64.tar --directory /opt/phantomjs/ --strip-components 1
ln -s /opt/phantomjs/bin/phantomjs /usr/bin/phantomjs
echo "PhantomJS is installed successfully";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment