Skip to content

Instantly share code, notes, and snippets.

@wearhere
Created October 16, 2016 21:38
Show Gist options
  • Save wearhere/f80c5cebf74375a700d49465ccd2a2c3 to your computer and use it in GitHub Desktop.
Save wearhere/f80c5cebf74375a700d49465ccd2a2c3 to your computer and use it in GitHub Desktop.
`npm install`s a Meteor application bundle during AWS Elastic Beanstalk deployment.
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/55npm_install.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
# Custom npm install to work with Meteor/s build command
export USER=root
export HOME=/tmp
export NODE_PATH=`ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin
echo "------------------------------ — Installing NPM modules for Meteor — -----------------------------------"
OUT=$([ -d "/tmp/deployment/application" ] && cd /tmp/deployment/application/programs/server && $NODE_PATH/npm install --production) || 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