diff --git a/lib/kamal/cli/base.rb b/lib/kamal/cli/base.rb index 7cd69fc6..3527a215 100644 --- a/lib/kamal/cli/base.rb +++ b/lib/kamal/cli/base.rb @@ -123,8 +123,9 @@ module Kamal::Cli 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 diff --git a/test/integration/lock_test.rb b/test/integration/lock_test.rb index c9d88a91..db086251 100644 --- a/test/integration/lock_test.rb +++ b/test/integration/lock_test.rb @@ -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