Forked from satyatechsavy/gist:9cebd2f5e8b85753bd2e
Created
January 20, 2017 21:41
-
-
Save nkconnor/503d8515d5b57b450c214bcdb5a409be to your computer and use it in GitHub Desktop.
AWS EB-Extension to install PhantomJS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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