refactor: call proxy-clear-config from post-app-rename-setup
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
16
plugins/nginx-vhosts/post-app-rename-setup
Executable file
16
plugins/nginx-vhosts/post-app-rename-setup
Executable file
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user