Method: AvoDeploy::Config#inherit_strategy

Defined in:
lib/avodeploy/config.rb

#inherit_strategy(strategy) ⇒ Object

Loads a strategy. Because the strategy files are loaded in the specified order, it’s possible to override tasks. This is how inheritance of strategies is realized.

Parameters:

  • the strategy to load



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/avodeploy/config.rb', line 54

def inherit_strategy(strategy)
  AvoDeploy::Deployment.instance.log.debug "Loading deployment strategy #{strategy.to_s}..."

  strategy_file_path = File.dirname(__FILE__) + "/strategy/#{strategy.to_s}.rb"

  if File.exist?(strategy_file_path)
    require strategy_file_path
  else
    raise RuntimeError, "The requested strategy '#{strategy.to_s}' does not exist"
  end
end