Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Let travis hook be called on Fail/Success/Start builds

  • Loading branch information...
commit 0db291d6b853e299a41f284bd92460182f6c4e8c 1 parent ee20e52
@sergeylukin sergeylukin authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/scripts/travis.coffee
View
13 src/scripts/travis.coffee
@@ -17,6 +17,7 @@
# Author:
# sferik
# nesQuick
+# sergeylukin
url = require('url')
querystring = require('querystring')
@@ -46,8 +47,12 @@ module.exports = (robot) ->
user.room = query.room if query.room
user.type = query.type if query.type
- payload = JSON.parse req.body.payload
+ try
+ payload = JSON.parse req.body.payload
+
+ gitio payload.compare_url, (err, data) ->
+ robot.send user, "#{payload.status_message.toUpperCase()} build (#{payload.build_url}) on #{payload.repository.name}:#{payload.branch} by #{payload.author_name} with commit (#{if err then payload.compare_url else data})"
+
+ catch error
+ console.log "travis hook error: #{error}. Payload: #{req.body.payload}"
- if payload.status isnt 0
- gitio payload.compare_url, (err, data) ->
- robot.send user, "#{payload.author_name} broke the build (#{payload.build_url}) of #{payload.repository.name} with commit (#{if err then payload.compare_url else data})!"
Please sign in to comment.
Something went wrong with that request. Please try again.