fix: ensure we cleanup the data directory on app deletion
Also use a variable for the clone root dir.
This commit is contained in:
1 parent
eb9a75496c
commit
10468ce47d
2 files changed
+7
-2
No files matched your search
@@ -196,10 +196,12 @@ cmd-git-sync() {
|
|||||||
|
|
||||||
verify_app_name "$APP"
|
verify_app_name "$APP"
|
||||||
|
|
||||||
if [[ -d "$DOKKU_LIB_ROOT/data/git/$APP" ]]; then
|
local APP_CLONE_ROOT="$DOKKU_LIB_ROOT/data/git/$APP"
|
||||||
|
|
||||||
|
if [[ -d "$APP_CLONE_ROOT" ]]; then
|
||||||
if has_tty eq 0; then
|
if has_tty eq 0; then
|
||||||
cmd-git-unlock "$APP"
|
cmd-git-unlock "$APP"
|
||||||
if [[ -d "$DOKKU_LIB_ROOT/data/git/$APP" ]]; then
|
if [[ -d "$APP_CLONE_ROOT" ]]; then
|
||||||
dokku_log_fail "Failed to delete existing clone folder"
|
dokku_log_fail "Failed to delete existing clone folder"
|
||||||
exit 15
|
exit 15
|
||||||
fi
|
fi
|
||||||
@@ -266,6 +268,7 @@ cmd-git-unlock() {
|
|||||||
dokku_log_info1 "No clone folder exists app already unlocked"
|
dokku_log_info1 "No clone folder exists app already unlocked"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd-git-public-key() {
|
cmd-git-public-key() {
|
||||||
declare desc="outputs the dokku public deploy key"
|
declare desc="outputs the dokku public deploy key"
|
||||||
local cmd="git:public-key"
|
local cmd="git:public-key"
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ trigger-git-post-delete() {
|
|||||||
declare desc="destroys the git properties for a given app"
|
declare desc="destroys the git properties for a given app"
|
||||||
declare trigger="post-delete"
|
declare trigger="post-delete"
|
||||||
declare APP="$1"
|
declare APP="$1"
|
||||||
|
local APP_CLONE_ROOT="$DOKKU_LIB_ROOT/data/git/$APP"
|
||||||
|
|
||||||
fn-plugin-property-destroy "git" "$APP"
|
fn-plugin-property-destroy "git" "$APP"
|
||||||
|
rm -rf "$APP_CLONE_ROOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger-git-post-delete "$@"
|
trigger-git-post-delete "$@"
|
||||||
Reference in new issue
Block a user