Run interactive commands with the correct host

Fixes https://github.com/basecamp/kamal/issues/430
This commit is contained in:
Donal McBreen
2023-09-18 11:56:44 +01:00
parent 6b0f93a564
commit 0861730e0e
4 changed files with 33 additions and 2 deletions

View File

@@ -39,6 +39,10 @@ class Kamal::Commander
specific_hosts&.first || specific_roles&.first&.primary_host || config.primary_web_host
end
def primary_role
roles_on(primary_host).first
end
def roles
(specific_roles || config.roles).select do |role|
((specific_hosts || config.all_hosts) & role.hosts).any?