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'