fix: release deploy locks on exit and honor apps:lock
A deploy that exited before releasing its lock, such as after a failed build, left `.deploy.lock` behind, so `apps:locked` reported a lock nothing held and the build record stayed running. The lock is now released and the record finalized whenever the deploy exits. `apps:lock` never actually blocked deploys, as it only created the file deploys lock. It now creates its own lock that git pushes, `ps:rebuild`, `git:sync`, and the `git:from-*` commands refuse to deploy past, and `apps:locked` only reports a lock when the app was locked via `apps:lock` or a deploy is in progress. Locks created by `apps:lock` in older versions are migrated on install.
This commit is contained in:
17 files changed
+535
-69
No files matched your search
@@ -286,7 +286,7 @@ cmd-git-sync() {
|
||||
|
||||
# acquire_app_deploy_lock is not used as releasing it would finalize the
|
||||
# build record before the build starts
|
||||
acquire_advisory_lock "$APP_DEPLOY_LOCK_FILE" "exclusive" "$APP currently has a deploy lock in place. Waiting..." "$APP currently has a deploy lock in place. Exiting..."
|
||||
acquire_app_advisory_lock "$APP" "exclusive"
|
||||
|
||||
DOKKU_DEPLOY_BRANCH="$(fn-git-computed-deploy-branch "$APP")"
|
||||
CURRENT_REF="$(fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" 2>/dev/null || true)"
|
||||
|
||||
Reference in new issue
Block a user