fix: ensure app clones have domains setup

Closes #6146
This commit is contained in:
Jose Diaz-Gonzalez
2023-08-27 11:48:30 -04:00
parent fb5b605c4a
commit 71214be1bd
7 changed files with 30 additions and 22 deletions

View File

@@ -28,11 +28,11 @@ domains_setup() {
if [[ ! -f $APP_VHOST_PATH ]]; then
if [[ -n "$DEFAULT_VHOSTS" ]]; then
dokku_log_info1 "Creating new app virtual host file..."
dokku_log_info1_quiet "Creating new app virtual host file..."
echo "$DEFAULT_VHOSTS" >"$APP_VHOST_PATH"
chown "${DOKKU_SYSTEM_USER}:${DOKKU_SYSTEM_GROUP}" "$APP_VHOST_PATH"
else
dokku_log_info2 "Global server virtual host not set, disabling app vhost..."
dokku_log_info1_quiet "Global server virtual host not set, disabling app vhost..."
disable_app_vhost "$APP" --no-restart
fi
fi

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/domains/functions"
trigger-domains-post-app-clone-setup() {
declare desc="removes domain files when setting up a clone"
@@ -9,6 +10,7 @@ trigger-domains-post-app-clone-setup() {
local APP_ROOT="$DOKKU_ROOT/$NEW_APP"
rm -rf "$APP_ROOT/VHOST"
DOKKU_QUIET_OUTPUT=1 domains_setup "$NEW_APP"
}
trigger-domains-post-app-clone-setup "$@"