Files
dokku-mongo/post-app-rename-setup
Jose Diaz-Gonzalez 881f07df19 feat: implement service filtering
If a user implements the user-auth-service trigger in a plugin and that plugin does not echo the passed in app(s) on stdout, the app is assumed to not exist. This mirrors the functionality for applications in regards to auth filtering.

This may still need auditing to ensure it covers everything and doesn't cause issues, but local testing implies that everything is working as expected.
2022-07-07 02:54:14 -04:00

19 lines
549 B
Bash
Executable File

#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common-functions"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
plugin-post-app-rename-setup() {
declare OLD_APP_NAME="$1" NEW_APP_NAME="$2"
for SERVICE in $(fn-services-list false); do
if in_links_file "$SERVICE" "$OLD_APP_NAME"; then
add_to_links_file "$SERVICE" "$NEW_APP_NAME"
fi
done
}
plugin-post-app-rename-setup "$@"