Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/kamal/cli/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def reset_invocation(cli_class)
end

def ensure_run_directory
on(KAMAL.hosts) do
on(KAMAL.primary_host) do
execute(*KAMAL.server.ensure_run_directory)
end
end
Expand Down
9 changes: 9 additions & 0 deletions test/cli/lock_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ class CliLockTest < CliTestCase
end
end

test "acquire ensures the run directory only on the primary host" do
run_command("acquire", "-m", "hello").tap do |output|
assert_match "Running /usr/bin/env mkdir -p .kamal on 1.1.1.1", output
assert_no_match(/mkdir -p \.kamal on 1\.1\.1\.2/, output)
assert_no_match(/mkdir -p \.kamal on 1\.1\.1\.3/, output)
assert_no_match(/mkdir -p \.kamal on 1\.1\.1\.4/, output)
end
end

test "status when there is no deploy lock" do
SSHKit::Backend::Abstract.any_instance.stubs(:capture_with_debug)
.raises(RuntimeError, "cat: .kamal/lock-app/details: No such file or directory")
Expand Down