Skip to content

Commit

Permalink
Merge pull request #656 from DanielJackson-Oslo/informative-error-mes…
Browse files Browse the repository at this point in the history
…sage-on-lock

Informative message on lock error
  • Loading branch information
djmb authored Mar 7, 2024
2 parents 73a9276 + ad04bb7 commit 52bb40a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/kamal/cli/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ def raise_if_locked
yield
rescue SSHKit::Runner::ExecuteError => e
if e.message =~ /cannot create directory/
say "Deploy lock already in place!", :red
on(KAMAL.primary_host) { puts capture_with_debug(*KAMAL.lock.status) }
raise LockError, "Deploy lock found"
raise LockError, "Deploy lock found. Run 'kamal lock help' for more information"
else
raise e
end
Expand Down
2 changes: 1 addition & 1 deletion test/integration/lock_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LockTest < IntegrationTest
assert_match /Locked by: Deployer at .*\nVersion: #{latest_app_version}\nMessage: Integration Tests/m, status

error = kamal :deploy, capture: true, raise_on_error: false
assert_match /Deploy lock found/m, error
assert_match /Deploy lock found. Run 'kamal lock help' for more information/m, error

kamal :lock, :release

Expand Down

0 comments on commit 52bb40a

Please sign in to comment.