Skip to content
Merged
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/configuration/role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def hosts
end

def env_tags(host)
tagged_hosts.fetch(host).collect { |tag| config.env_tag(tag) }
tagged_hosts.fetch(host).collect { |tag| config.env_tag(tag) }.compact
end

def cmd
Expand Down
7 changes: 7 additions & 0 deletions test/configuration/role_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
assert_equal [ "1.1.1.3", "1.1.1.4" ], config_with_roles.role(:workers).hosts
end

test "missing env tag is ignored" do
@deploy_with_roles[:servers]["workers"]["hosts"] = [ { "1.1.1.3" => [ "job" ] } ]

role = Kamal::Configuration.new(@deploy_with_roles).role(:workers)
assert_equal "redis://a/b", role.env("1.1.1.3").clear["REDIS_URL"]
end

test "cmd" do
assert_nil config.role(:web).cmd
assert_equal "bin/jobs", config_with_roles.role(:workers).cmd
Expand Down