From 2fd887d40a54d37ea19cd3d0802b310374386d91 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 23 Jan 2016 11:54:59 +0100 Subject: [PATCH] output --- deployment.coffee | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/deployment.coffee b/deployment.coffee index f7ad95f..27ec8fa 100644 --- a/deployment.coffee +++ b/deployment.coffee @@ -55,7 +55,7 @@ module.exports = (robot) -> if pv d = deploy directory, pv, commands, target, program - res.reply d + res.send d else res.reply "Not a SVN or GIT repository" catch e @@ -127,14 +127,26 @@ deploy = (directory, projectVersionning, commands, target, program) -> output = "" for stmt in results - status = if stmt.status == 0 then 'OK' else 'KO' - output += "`#{stmt.command}` is *#{status}*\n" - - if stmt.status != 0 - output += "\n```#{stmt.stdout} #{stmt.stderr}```" + output += generateOutput stmt output +generateOutput = (stmt) -> + prefix = "deploy-" + Date.now() + status = + if stmt.status == 0 + "OK" + else + "Failed" + """ +

#{stmt.command}
#{status}

+
+ Outputs: STDOUT STDERR + + +
+ + """ buildDeployCommand = (directory, program, target) -> if program == 'mage'