fluke/devops-client/lib/devops-client/handler/deploy.rb
GGA Software Services LLC 02bf8b1bba initial commit
2014-05-08 17:06:06 +04:00

32 lines
697 B
Ruby

require "devops-client/handler/handler"
require "devops-client/options/deploy_options"
class Deploy < Handler
def initialize(host, def_options={})
self.host = host
# self.def_options = def_options
@options_parser = DeployOptions.new(ARGV, def_options)
end
def handle
if ARGV.size > 1
self.options = @options_parser.deploy_options
deploy_handler @options_parser.args
else
@options_parser.invalid_command
end
end
def deploy_handler args
tags = options[:tags]
names = args[1..-1]
if names.empty?
@options_parser.invalid_deploy_command
abort(r)
end
post_chunk("/deploy", :names => names, :tags => tags)
end
end