summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2017-11-20 10:17:40 +0000
committerTristan Maat <tristan.maat@codethink.co.uk>2017-12-06 11:06:24 +0000
commit162abf8b072cecaac7a510e4f52d62fdd2865c32 (patch)
tree74d2a089e4e2dd7d5db2d4c3090e5629e9c0e612
parent19f978236ff0ba6444266e0577c945882a9479c2 (diff)
downloadbuildstream-event-hooks.tar.gz
-rw-r--r--buildstream/_pipeline.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index 2a64e2f99..0e6d2c65d 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -309,18 +309,39 @@ class Pipeline():
self.session_elements = len(dependencies)
self.message(MessageType.START, "Starting track")
+ self.context._hooks.run_hook(
+ 'track-start',
+ "Starting track",
+ self.project.name
+ )
elapsed, status = scheduler.run([track])
changed = len(track.processed_elements)
if status == SchedStatus.ERROR:
+ self.context._hooks.run_hook(
+ 'track-fail',
+ "Track failed",
+ self.project.name
+ )
self.message(MessageType.FAIL, "Track failed", elapsed=elapsed)
raise PipelineError()
elif status == SchedStatus.TERMINATED:
+ self.context._hooks.run_hook(
+ 'track-fail',
+ "Terminated after updating {} source references".format(changed),
+ self.project.name
+ )
self.message(MessageType.WARN,
"Terminated after updating {} source references".format(changed),
elapsed=elapsed)
raise PipelineError()
else:
+ self.context._hooks.run_hook(
+ 'track-complete',
+ "Updated {} source references".format(changed),
+ self.project.name
+ )
+
self.message(MessageType.SUCCESS,
"Updated {} source references".format(changed),
elapsed=elapsed)