class Stratocumulus::Runner
Public Class Methods
new(config_path)
click to toggle source
# File lib/stratocumulus/runner.rb, line 5 def initialize(config_path) @config = YAML.load(File.read(config_path)) end
Public Instance Methods
run()
click to toggle source
# File lib/stratocumulus/runner.rb, line 9 def run @config["databases"].each do |database_config| begin database = Database.build(database_config) upload(database, database_config["storage"]) rescue => e $stderr.puts "warning: #{e.message}" ensure database.cleanup end end end
Private Instance Methods
storage()
click to toggle source
# File lib/stratocumulus/runner.rb, line 29 def storage Storage.new(@config["s3"]) end
upload(database, storage_type)
click to toggle source
# File lib/stratocumulus/runner.rb, line 24 def upload(database, storage_type) fail "#{storage_type} is not supported" unless storage_type == "s3" storage.upload(database) end