From 1930f67368551ba2777bf9c2ff3bf1ff2ed47c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Wed, 7 Jun 2017 15:36:13 +0200 Subject: [PATCH] Improve assemble script. Run script not needed anymore --- .s2i/bin/assemble | 6 ++++-- .s2i/bin/run | 19 ------------------- 2 files changed, 4 insertions(+), 21 deletions(-) delete mode 100755 .s2i/bin/run diff --git a/.s2i/bin/assemble b/.s2i/bin/assemble index 5548d44..0648da5 100755 --- a/.s2i/bin/assemble +++ b/.s2i/bin/assemble @@ -15,7 +15,9 @@ 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 +echo "---> Generating symlinks ..." +for file in node_modules/$package_name/*; do + ln -s "$file" "$(basename "$file")" +done fix-permissions ./ diff --git a/.s2i/bin/run b/.s2i/bin/run deleted file mode 100755 index c6fa732..0000000 --- a/.s2i/bin/run +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# Fail on any non-zero return code -set -e - -if [ -e "/opt/app-root/etc/generate_container_user" ]; then - source /opt/app-root/etc/generate_container_user -fi - -# Allow users to inspect/debug the builder image itself, by using: -# $ docker run -i -t openshift/centos-nodejs-builder --debug -# -[ "$1" == "--debug" ] && exec /bin/bash - -# Run NodeJS Server -echo "Running NodeJS Server..." -export NODE_ENV=production -cd main -run_node