diff options
Diffstat (limited to 'ick2')
-rw-r--r-- | ick2/actions.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ick2/actions.py b/ick2/actions.py index 3d77aa5..8c52475 100644 --- a/ick2/actions.py +++ b/ick2/actions.py @@ -14,6 +14,7 @@ import base64 +import copy import json import os import tempfile @@ -496,7 +497,7 @@ class NotifyAction(Action): # pragma: no cover notify = { 'recipients': recipients, - 'build': build, + 'build': self.mangle_build(build), 'log': log, } @@ -504,6 +505,17 @@ class NotifyAction(Action): # pragma: no cover env.report(0, 'Notified about build {} ending\n'.format(build_id)) + def mangle_build(self, build): + b = copy.deepcopy(build) + exit_code = build.get('exit_code') + if exit_code is None: + b['status'] = 'BUILDING' + elif exit_code == 0: + b['status'] = 'SUCCESS' + else: + b['status'] = 'FAILED' + return b + def make_directory_empty(env, dirname): return env.runcmd( |