Skip to content

Instantly share code, notes, and snippets.

@markudevelop
Forked from wearhere/custom-npm-install.config
Created December 23, 2016 10:11
Show Gist options
  • Save markudevelop/75b19bd343dbf9b4a1b50083cf9bad40 to your computer and use it in GitHub Desktop.
Save markudevelop/75b19bd343dbf9b4a1b50083cf9bad40 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