From 1ec69d3764764c4d090cd30c1c97d8e9995bb863 Mon Sep 17 00:00:00 2001 From: Daniel Jackson Date: Tue, 23 Jan 2024 08:33:07 +0100 Subject: [PATCH] Tell user about 'kamal lock help' when deploy fails due to a lock --- lib/kamal/cli/base.rb | 2 +- test/integration/lock_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kamal/cli/base.rb b/lib/kamal/cli/base.rb index fce1b16e..2f63eec5 100644 --- a/lib/kamal/cli/base.rb +++ b/lib/kamal/cli/base.rb @@ -124,7 +124,7 @@ module Kamal::Cli rescue SSHKit::Runner::ExecuteError => e if e.message =~ /cannot create directory/ 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 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