11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/lita/handlers/gitlab_ci.rb', line 11
def webhook(request, response)
data = parse_json(request.body)
project_name = data["project_name"]
build_status = data["build_status"]
build_date = Time.parse(data["build_started_at"]) branch = data["ref"]
message_body = "#{project_name} (#{branch}) build on #{build_date} and #{build_status}."
rooms = Lita.config.handlers.gitlab_ci.rooms
rooms.each do |room|
target = Source.new(room: room)
robot.send_message(target, message_body)
end
response.body << message_body
end
|