Skip to content

Commit

Permalink
fix: correct issue with cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
josegonzalez committed Mar 14, 2024
1 parent b9ea34c commit 02973ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/builds/plugin.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[plugin]
description = "dokku core builds plugin"
version = "0.33.6"
version = "0.33.9"
[plugin.config]
11 changes: 6 additions & 5 deletions plugins/builds/subcommands/cancel
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ cmd-builds-cancel() {
declare cmd="builds:cancel"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1"
local APP_DEPLOY_LOCK_FILE PROCESS_ID PROCESS_GROUP_ID
verify_app_name "$APP"

local APP_DEPLOY_LOCK_FILE PROCESS_ID PROCESS_GROUP_ID
APP_DEPLOY_LOCK_FILE="$DOKKU_ROOT/$APP/.deploy.lock"
APP_DEPLOY_LOCK_FILE="$DOKKU_LIB_ROOT/data/apps/$APP/.deploy.lock"
if [[ ! -f "$APP_DEPLOY_LOCK_FILE" ]]; then
dokku_log_info1 "No matching app deploy found"
dokku_log_info1 "App not currently deploying"
return
fi

Expand All @@ -25,12 +26,12 @@ cmd-builds-cancel() {

PROCESS_GROUP_ID="$(ps -o pgid= "$PROCESS_ID" || true)"
if [[ -z "$PROCESS_ID" ]]; then
dokku_log_info1 "No matching app deploy found"
dokku_log_info1 "Unable to find process group id for app deploy"
return
fi

dokku_log_info1 "Killing app deploy"
kill -quit -- "-${PROCESS_GROUP_ID}" && rm -f "$DOKKU_ROOT/$APP/.deploy.lock"
kill -quit -- "-${PROCESS_GROUP_ID}" && rm -f "$APP_DEPLOY_LOCK_FILE"
}

ps_kill_deploy_cmd "$@"
cmd-builds-cancel "$@"

0 comments on commit 02973ba

Please sign in to comment.