Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions bin/start-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ mkfifo $psmgr
erb config/nginx.conf.erb > config/nginx.conf

n=1
while getopts :f option ${@:1:2}
while getopts :fn option "${@:1:2}"
do
case "${option}"
in
f) FORCE=$OPTIND; n=$((n+1));;
n) NO_SERVER=$OPTIND; n=$((n+1));;
esac
done

Expand All @@ -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"
Expand Down