From 56ddad5ae9a5daa9e3934fe7409542e774c9675a Mon Sep 17 00:00:00 2001 From: dbroqua Date: Thu, 20 Sep 2018 15:22:46 +0200 Subject: [PATCH] DEBUG --- .ebextensions/00_deploy_npm.config | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .ebextensions/00_deploy_npm.config diff --git a/.ebextensions/00_deploy_npm.config b/.ebextensions/00_deploy_npm.config new file mode 100644 index 0000000..901cd2e --- /dev/null +++ b/.ebextensions/00_deploy_npm.config @@ -0,0 +1,37 @@ +files: + "/opt/elasticbeanstalk/env.vars" : + mode: "000775" + owner: root + group: users + content: | + export NPM_CONFIG_LOGLEVEL=error + export NODE_PATH=`ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin + "/opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh" : + mode: "000775" + owner: root + group: users + content: | + #!/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 && $NODE_PATH/npm install 2>&1) || error_exit "Failed to run npm install. $OUT" $? + echo $OUT + "/opt/elasticbeanstalk/hooks/configdeploy/pre/50npm.sh" : + mode: "000666" + owner: root + group: users + content: | + #no need to run npm install during configdeploy