From f75a0408837eb9fd31f92f5b4d9d055029033303 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Tue, 8 Mar 2016 20:37:39 +0100 Subject: [PATCH 1/2] scripts(start-nginx): add no server option --- bin/start-nginx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/start-nginx b/bin/start-nginx index 804d449f..e3f59b11 100755 --- a/bin/start-nginx +++ b/bin/start-nginx @@ -8,11 +8,12 @@ mkfifo $psmgr erb config/nginx.conf.erb > config/nginx.conf n=1 -while getopts :f option ${@:1:2} +while getopts :f:n option "${@:1:3}" do case "${option}" in f) FORCE=$OPTIND; n=$((n+1));; + n) NO_SERVER=$OPTIND; n=$((n+1));; esac done @@ -28,16 +29,21 @@ echo 'buildpack=nginx at=logs-initialized' echo 'logs' >$psmgr ) & +if [[ -z "$NO_SERVER" ]] +then + #Start App Server ( #Take the command passed to this bin and start it. #E.g. bin/start-nginx bundle exec unicorn -c config/unicorn.rb - COMMAND=${@:$n} + COMMAND=${*:$n} echo "buildpack=nginx at=start-app cmd=$COMMAND" $COMMAND echo 'app' >$psmgr ) & +fi + if [[ -z "$FORCE" ]] then FILE="/tmp/app-initialized" From 85a1f537a2f71a33dd53d7b15dcaae4eb641c92b Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Tue, 8 Mar 2016 20:42:57 +0100 Subject: [PATCH 2/2] scripts(start-nginx): fix options --- bin/start-nginx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/start-nginx b/bin/start-nginx index e3f59b11..ac690cea 100755 --- a/bin/start-nginx +++ b/bin/start-nginx @@ -8,7 +8,7 @@ mkfifo $psmgr erb config/nginx.conf.erb > config/nginx.conf n=1 -while getopts :f:n option "${@:1:3}" +while getopts :fn option "${@:1:2}" do case "${option}" in