Class: Lita::Handlers::Teamcity

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

Instance Method Summary collapse

Instance Method Details

#build(response) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/lita/handlers/teamcity.rb', line 33

def build(response)
  Lita.logger.debug(response.matches)
  Lita.logger.debug(response.args)
  Lita.logger.debug(response.room.)
  options = {
    comment: {text: "Triggered by #{response.user.name} in room #{response.room.name} via chatbot"},
  }
  options[:branchName] = response.args[2] if response.args[2]

  result = client.create_buildqueue(response.args[1], options)
  Lita.logger.debug(result)

  message = {
    title: 'Done!',
    text: render_template('build', build: result),
  }
  reply(response, message)
end

#builds(response) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/lita/handlers/teamcity.rb', line 23

def builds(response)
  records = client.builds
  Lita.logger.debug(records)
  message = {
    title: 'Builds',
    text: render_template('builds', builds: records),
  }
  reply(response, message)
end

#projects(response) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/lita/handlers/teamcity.rb', line 14

def projects(response)
  message = {
    title: 'Projects',
    text: render_template('projects', projects: client.projects),
  }
  
  reply(response, message)
end