Fix loading of configuration

This commit is contained in:
Glenn Y. Rolland 2020-04-11 21:53:45 +02:00
parent f42ace98bb
commit 6411f2b06e

View file

@ -111,17 +111,38 @@ module Pushokku
deployment.run deployment.run
end end
def self.find_filter(config, name)
matches = config.filters.select { |filter| filter.name == name }
if matches.size > 1
raise "Multiple filters have the same name (unicity)"
end
return matches.first
end
def self.validate_config!(config)
pp config
#config.deployments.each do |deployment_config|
# handle_deployment(config, deployment_config)
#end
end
def self.apply_config!(config)
config.deployments.each do |deployment_config|
# handle_deployment(config, deployment_config)
end
end
def self.run(args) def self.run(args)
app = Cli.new app = Cli.new
opts = app.parse_options(args) opts = app.parse_options(args)
config = app.load_config(opts["config_file"]) config = app.load_config(opts["config_file"])
# env_config = App.get_config(config, opts["environment"]) # env_config = App.get_config(config, opts["environment"])
config.deployments.each do |deployment_config| validate_config!(config)
handle_deployment(config, deployment_config) apply_config!(config)
end
exit 2 exit 0
end end
end end
end end