Move VHOST file creation to a single domains:setup command

This helps remove duplication and also ensures that all hosts have a proper setup after running `make copyfiles`

Note that this command is not exposed in help as it is not generally useful to developers
This commit is contained in:
Jose Diaz-Gonzalez committed 2014-12-11 01:36:44 -05:00
1 parent 66171551d8
commit e84526490e
3 files changed
+32 -32

No files matched your search

+1 -19
View File
@@ -23,25 +23,7 @@ restart_nginx () {
if [[ -n "$NO_VHOST" ]]; then
echo "-----> NO_VHOST config detected"
elif [[ -f "$DOKKU_ROOT/VHOST" ]]; then
[ -f $VHOST_PATH ] || {
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
fi
echo $hostname > $VHOST_PATH
fi
}
dokku domains:setup $APP
fi
NONSSL_VHOSTS=`cat $VHOST_PATH`