A NodeJS application to use in OpenShift
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
509 B

#!/bin/bash
if [ -z "$NPM_PACKAGE_TO_INSTALL" ]; then
echo "Warning: NPM_PACKAGE_TO_INSTALL is not defined !"
echo "Switching back to the default S2I behavior"
exec "$STI_SCRIPTS_PATH/assemble"
fi
# Exit on any error
set -e
echo "---> Installing application from NPM ..."
npm install "$NPM_PACKAGE_TO_INSTALL"
# Trim package name (remove the version number)
package_name="${NPM_PACKAGE_TO_INSTALL%@*}"
echo "---> Linking application ..."
ln -s "node_modules/$package_name" main
fix-permissions ./