Tell user about 'kamal lock help' when deploy fails due to a lock

This commit is contained in:
Daniel Jackson
2024-01-23 08:33:07 +01:00
parent 2d1a0dc9ba
commit 1ec69d3764
2 changed files with 2 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ module Kamal::Cli
rescue SSHKit::Runner::ExecuteError => e rescue SSHKit::Runner::ExecuteError => e
if e.message =~ /cannot create directory/ if e.message =~ /cannot create directory/
on(KAMAL.primary_host) { puts capture_with_debug(*KAMAL.lock.status) } on(KAMAL.primary_host) { puts capture_with_debug(*KAMAL.lock.status) }
raise LockError, "Deploy lock found. See https://kamal-deploy.org/docs/commands#checking-and-setting-the-lock" raise LockError, "Deploy lock found. Run 'kamal lock help' for more information"
else else
raise e raise e
end end

View File

@@ -10,7 +10,7 @@ class LockTest < IntegrationTest
assert_match /Locked by: Deployer at .*\nVersion: #{latest_app_version}\nMessage: Integration Tests/m, status assert_match /Locked by: Deployer at .*\nVersion: #{latest_app_version}\nMessage: Integration Tests/m, status
error = kamal :deploy, capture: true, raise_on_error: false 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 kamal :lock, :release