Class: KuberKit::EnvFileReader::Strategies::EnvGroup

Inherits:
Abstract show all
Defined in:
lib/kuber_kit/env_file_reader/strategies/env_group.rb

Instance Method Summary collapse

Instance Method Details

#read(shell, env_group) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/kuber_kit/env_file_reader/strategies/env_group.rb', line 7

def read(shell, env_group)
  content = {}
  env_group.env_files.each do |env_file_name|
    env_file = env_file_store.get(env_file_name)

    if env_file.is_a?(KuberKit::Core::EnvFiles::EnvGroup)
      raise "EnvGroup inside another EnvGroup is not supported"
    end

    result   = artifact_file.read(shell, env_file)
    content  = content.merge(result)
  end
  content
end