Pass around Roles instead of Strings
Avoid looking up roles by names everywhere. This avoids the awkward role/role_config naming as well.
This commit is contained in:
@@ -8,9 +8,8 @@ class Kamal::Cli::Env < Kamal::Cli::Base
|
||||
execute *KAMAL.auditor.record("Pushed env files"), verbosity: :debug
|
||||
|
||||
KAMAL.roles_on(host).each do |role|
|
||||
role_config = KAMAL.config.role(role)
|
||||
execute *KAMAL.app(role: role).make_env_directory
|
||||
upload! StringIO.new(role_config.env_file), role_config.host_env_file_path, mode: 400
|
||||
upload! StringIO.new(role.env_file), role.host_env_file_path, mode: 400
|
||||
end
|
||||
end
|
||||
|
||||
@@ -36,7 +35,6 @@ class Kamal::Cli::Env < Kamal::Cli::Base
|
||||
execute *KAMAL.auditor.record("Deleted env files"), verbosity: :debug
|
||||
|
||||
KAMAL.roles_on(host).each do |role|
|
||||
role_config = KAMAL.config.role(role)
|
||||
execute *KAMAL.app(role: role).remove_env_file
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user