diff --git a/index.js b/index.js index 8694cbe..f909bbc 100644 --- a/index.js +++ b/index.js @@ -81,9 +81,22 @@ var handlers = { }, build: function(body) { - console.log('build event NYI because not documented'); - console.log(body); - return null; + + var id = body.build_id; + var status = body.build_status; + + var isFinished = body.build_finished_at !== null; + var duration = body.build_duration; + + var projectName = body.project_name; + var stage = body.build_stage; + + var msg = []; + msg.push(projectName + ': build #' + id + ' (' + stage + ') changed status: ' + status); + if (isFinished) + msg.push('build finished in ' + duration + ' seconds. '); + + return msg; } };