Skip to content

Instantly share code, notes, and snippets.

@adamrights
Created April 17, 2014 15:00
Show Gist options
  • Save adamrights/10990045 to your computer and use it in GitHub Desktop.
Save adamrights/10990045 to your computer and use it in GitHub Desktop.
#!/bin/bash
. /opt/elasticbeanstalk/env.vars
function error_exit
{
eventHelper.py --msg "$1" --severity ERROR
exit $2
}
#install not-installed yet app node_modules
if [ ! -d "/var/node_modules" ]; then
mkdir /var/node_modules ;
fi
if [ -d /tmp/deployment/application ]; then
ln -s /var/node_modules /tmp/deployment/application/
fi
OUT=$([ -d "/tmp/deployment/application" ] && cd /tmp/deployment/application && /opt/elasticbeanstalk/node-install/node-v$NODE_VER-linux-$ARCH/bin/npm install 2>&1) || error_exit "Failed to run npm install. $OUT" $?
echo $OUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment