Remove linked app from links file when destroying app

This commit is contained in:
Loïc Guitaut
2015-09-29 20:06:53 +02:00
parent 78314ef8ad
commit bb7d44f39e
7 changed files with 62 additions and 6 deletions

16
pre-delete Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
PLUGIN_BASE_PATH="$PLUGIN_PATH"
if [[ -n $DOKKU_API_VERSION ]]; then
PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
fi
source "$PLUGIN_BASE_PATH/common/functions"
source "$(dirname "$0")/functions"
source "$(dirname "$0")/config"
APP="$1"
for SERVICE in "$PLUGIN_DATA_ROOT"/*; do
remove_from_links_file "$(basename "$SERVICE")" "$APP"
done
exit 0