Class: EcrDeploy::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/ecr_deploy/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Config

Returns a new instance of Config.



4
5
6
# File 'lib/ecr_deploy/config.rb', line 4

def initialize(path)
  @config = YAML.load(IO.read(path))
end

Instance Method Details

#base_configObject



8
9
10
# File 'lib/ecr_deploy/config.rb', line 8

def base_config
  @config["base_config"]
end

#environmentsObject



24
25
26
# File 'lib/ecr_deploy/config.rb', line 24

def environments
  @config.keys.reject { |e| e == "base_config" }
end

#register_tasks(environment) ⇒ Object



20
21
22
# File 'lib/ecr_deploy/config.rb', line 20

def register_tasks(environment)
  @config[environment]["register_tasks"] || []
end

#run_tasks(environment) ⇒ Object



16
17
18
# File 'lib/ecr_deploy/config.rb', line 16

def run_tasks(environment)
  @config[environment]["run_tasks"] || []
end

#services(environment) ⇒ Object



12
13
14
# File 'lib/ecr_deploy/config.rb', line 12

def services(environment)
  @config[environment]["services"] || []
end