feat: expand the PORT environment variable when provided

Refs #2793
Refs #3196
This commit is contained in:
Jose Diaz-Gonzalez
2018-07-29 13:32:04 -04:00
parent 2db8f93507
commit c924bdef04
3 changed files with 26 additions and 22 deletions

View File

@@ -394,21 +394,13 @@ get_app_running_container_types() {
get_cmd_from_procfile() {
declare desc="parse cmd from app Procfile"
local APP=$1; local PROC_TYPE=$2; local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
declare APP="$1" PROC_TYPE="$2" PORT="$3"
local DOKKU_PROCFILE="$DOKKU_ROOT/$APP/DOKKU_PROCFILE"
local COMMAND
verify_app_name "$APP"
if [[ -f $DOKKU_PROCFILE ]]; then
local line; local name; local command
while read -r line || [[ -n "$line" ]]; do
if [[ -z "$line" ]] || [[ "$line" == "#"* ]]; then
continue
fi
line=$(strip_inline_comments "$line")
name="${line%%:*}"
command="${line#*:[[:space:]]}"
[[ "$name" == "$PROC_TYPE" ]] && echo "$command" && break
done < "$DOKKU_PROCFILE"
fi
[[ ! -f $DOKKU_PROCFILE ]] && return
procfile-util show -p "$PROC_TYPE" --port "$PORT"
}
is_deployed() {