fix urls command when NO_VHOST=1 + tests. fixes #1294

This commit is contained in:
Michael Hobbs
2015-07-09 12:12:49 -07:00
parent aa55f027a4
commit 033a267573
3 changed files with 54 additions and 17 deletions

View File

@@ -180,6 +180,8 @@ case "$1" in
verify_app_name "$2"
APP="$2";
[[ "$DOKKU_ROOT/$APP/ENV" ]] && source "$DOKKU_ROOT/$APP/ENV"
if [[ -s "$DOKKU_ROOT/$APP/URLS" ]]; then
case "$1" in
url)
@@ -198,7 +200,7 @@ case "$1" in
SCHEME="https"
fi
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
if [[ -f "$DOKKU_ROOT/VHOST" ]] && [[ "$NO_VHOST" != "1" ]]; then
echo "$SCHEME://$(< "$DOKKU_ROOT/VHOST")"
else
for PORT_FILE in $DOKKU_ROOT/$APP/PORT.*; do

View File

@@ -133,6 +133,10 @@ EOF
dokku_log_info1 "VHOST support disabled, deleting $APP/VHOST"
rm "$DOKKU_ROOT/$APP/VHOST"
fi
if [[ -f "$DOKKU_ROOT/$APP/URLS" ]]; then
dokku_log_info1 "VHOST support disabled, deleting $APP/URLS"
rm "$DOKKU_ROOT/$APP/URLS"
fi
if [[ -f "$DOKKU_ROOT/$APP/nginx.conf" ]]; then
dokku_log_info1 "VHOST support disabled, deleting nginx.conf"
rm "$DOKKU_ROOT/$APP/nginx.conf"