2014-01-16 15:25:40 +01:00
|
|
|
module Middleman
|
|
|
|
module Deploy
|
|
|
|
module Methods
|
|
|
|
class Git < Base
|
|
|
|
def process
|
2015-08-16 20:06:10 +02:00
|
|
|
puts "## Deploying via git to remote=\"#{options.remote}\" and branch=\"#{options.branch}\""
|
2014-01-16 15:25:40 +01:00
|
|
|
|
2015-08-16 20:06:10 +02:00
|
|
|
camelized_strategy = options.strategy.to_s.split('_').map(&:capitalize).join
|
2014-01-16 15:25:40 +01:00
|
|
|
strategy_class_name = "Middleman::Deploy::Strategies::Git::#{camelized_strategy}"
|
2015-08-16 20:06:10 +02:00
|
|
|
strategy_instance = strategy_class_name.constantize.new(build_dir, options.remote, options.branch, options.commit_message)
|
2014-01-16 15:25:40 +01:00
|
|
|
|
|
|
|
strategy_instance.process
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|