Update pre-delete
This commit is contained in:
1 parent
4e88c534b7
commit
e5aec5b141
1 file changed
+2
-2
@@ -5,7 +5,7 @@ source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|||||||
apps_pre_delete() {
|
apps_pre_delete() {
|
||||||
declare desc="apps pre-delete plugin trigger"
|
declare desc="apps pre-delete plugin trigger"
|
||||||
local trigger="apps_pre_delete"
|
local trigger="apps_pre_delete"
|
||||||
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache"; local CACHE_DIR_ON_HOST="$DOKKU_ROOT_ON_HOST/$APP/cache"
|
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG"); local CACHE_DIR="$DOKKU_ROOT/$APP/cache"; local CACHE_HOST_ROOT="$DOKKU_HOST_ROOT/$APP/cache"
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
if ! is_image_herokuish_based "$IMAGE"; then
|
if ! is_image_herokuish_based "$IMAGE"; then
|
||||||
@@ -13,7 +13,7 @@ apps_pre_delete() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d $CACHE_DIR ]]; then
|
if [[ -d $CACHE_DIR ]]; then
|
||||||
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_DIR_ON_HOST:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
docker run "$DOKKU_GLOBAL_RUN_ARGS" --rm -v "$CACHE_HOST_ROOT:/cache" "$IMAGE" find /cache -depth -mindepth 1 -maxdepth 1 -exec rm -Rf {} \; || true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user