From 9111902542cf9fc0fc3d93f9d36e1ea9001118f9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 11 Dec 2014 02:09:54 -0500 Subject: [PATCH] Fix issue where VHOST was not properly being set The URL file is being rewritten on every deploy by `dokku deploy` and thus that file was incorrect. Instead, we just reuse the old logic from the nginx-vhosts plugin to handle creation of the VHOST file --- plugins/domains/commands | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/plugins/domains/commands b/plugins/domains/commands index 828c167c6..16f931fbf 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -19,22 +19,18 @@ case "$1" in if [[ ! -f $VHOST_PATH ]]; then echo "-----> Creating new $VHOST_PATH..." - if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then - cat "$DOKKU_ROOT/$APP/URL" > $VHOST_PATH - else - VHOST=$(< "$DOKKU_ROOT/VHOST") - SUBDOMAIN=${APP/%\.${VHOST}/} - hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST) - if [[ ! -n $hostname ]]; then - if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then - hostname="${APP/\//-}" - else - hostname="${APP/\//-}.$VHOST" - fi + VHOST=$(< "$DOKKU_ROOT/VHOST") + SUBDOMAIN=${APP/%\.${VHOST}/} + hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST) + if [[ ! -n $hostname ]]; then + if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then + hostname="${APP/\//-}" + else + hostname="${APP/\//-}.$VHOST" fi - - echo $hostname > $VHOST_PATH fi + + echo $hostname > $VHOST_PATH fi ;;