Class: Lita::Handlers::KarotzDeployHook

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/karotz_deploy_hook.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_config(config) ⇒ Object



6
7
8
# File 'lib/lita/handlers/karotz_deploy_hook.rb', line 6

def self.default_config(config)
  config.karotz_deployment_endpoint = nil
end

Instance Method Details

#notify_karotz(message) ⇒ Object



15
16
17
18
19
# File 'lib/lita/handlers/karotz_deploy_hook.rb', line 15

def notify_karotz(message)
  matches = message.matches[0]
  data = { deployer: matches[0], project: matches[1], branch: matches[2], environment: matches[3] }
  RestClient.post "#{karotz_deployment_endpoint}?#{query_string(data)}", {}
end