diff --git a/docs/development/plugin-triggers.md b/docs/development/plugin-triggers.md index 202c74a9d..6f884fc72 100644 --- a/docs/development/plugin-triggers.md +++ b/docs/development/plugin-triggers.md @@ -527,7 +527,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x ### `network-clear-config` - Description: Clears network configuration -- Invoked by: `internally triggered by proxy-clear-config within proxy implementations` +- Invoked by: `internally triggered within proxy implementations` - Arguments: `$APP` - Example: diff --git a/plugins/apps/subcommands/rename b/plugins/apps/subcommands/rename index 5ce94b69a..dbf69b17c 100755 --- a/plugins/apps/subcommands/rename +++ b/plugins/apps/subcommands/rename @@ -25,7 +25,6 @@ cmd-apps-rename() { apps_create "$NEW_APP" cp -a "$DOKKU_ROOT/$OLD_APP/." "$DOKKU_ROOT/$NEW_APP" plugn trigger post-app-rename-setup "$OLD_APP" "$NEW_APP" - plugn trigger proxy-clear-config "$NEW_APP" DOKKU_APPS_FORCE_DELETE=1 apps_destroy "$OLD_APP" [[ -f "$DOKKU_ROOT/$NEW_APP/URLS" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/URLS" [[ -f "$DOKKU_ROOT/$NEW_APP/VHOST" ]] && sed -i -e "s/$OLD_APP/$NEW_APP/g" "$DOKKU_ROOT/$NEW_APP/VHOST" diff --git a/plugins/nginx-vhosts/post-app-rename-setup b/plugins/nginx-vhosts/post-app-rename-setup new file mode 100755 index 000000000..05ab658f1 --- /dev/null +++ b/plugins/nginx-vhosts/post-app-rename-setup @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -eo pipefail +[[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions" +source "$PLUGIN_AVAILABLE_PATH/proxy/functions" + +trigger-nginx-vhosts-post-app-rename-setup() { + declare desc="calls proxy-clear-config" + declare trigger="post-app-rename-setup" + declare OLD_APP="$1" NEW_APP="$2" + + plugn trigger proxy-clear-config "$NEW_APP" +} + +trigger-nginx-vhosts-post-app-rename-setup "$@"