refactor: call proxy-clear-config from post-app-rename-setup

This commit is contained in:
Jose Diaz-Gonzalez
2020-02-17 06:11:52 -05:00
parent 0740636d53
commit c2c2e2ccbd
3 changed files with 17 additions and 2 deletions

View File

@@ -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:

View File

@@ -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"

View 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 "$@"