feat: move URLS and VHOST modifications to post-app-rename-setup

This commit is contained in:
Jose Diaz-Gonzalez
2020-02-17 06:17:13 -05:00
parent c2c2e2ccbd
commit 3a961d2de7
2 changed files with 14 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-domains-post-app-rename-setup() {
declare desc="updates VHOST and URLS files during rename"
declare trigger="post-app-rename-setup"
declare OLD_APP="$1" NEW_APP="$2"
[[ -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"
}
trigger-domains-post-app-rename-setup "$@"