Skip to content

Commit

Permalink
Add build statistics to TC engine
Browse files Browse the repository at this point in the history
  • Loading branch information
agc93 committed Jun 25, 2018
1 parent 5a19094 commit 87bf69b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Cake.TeamCity.Module/TeamCityEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ private void OnTaskTeardown(object sender, TaskTeardownEventArgs e)
if (b.IsRunningOnTeamCity)
{
var tc = b.TeamCity;
var duration = e.TaskTeardownContext.Duration.TotalMilliseconds.ToString("0");
// we really should add build statistic values to the TeamCity stuff in Cake, but this will do for now.
e.TaskTeardownContext.Log.Information($"##teamcity[buildStatisticValue key='Block.{e.TaskTeardownContext.Task.Name}.Duration' value='{duration}']");
tc.WriteEndProgress($"Completed running {e.TaskTeardownContext.Task.Name} task");
tc.WriteEndBlock(e.TaskTeardownContext.Task.Name);
}
Expand Down

0 comments on commit 87bf69b

Please sign in to comment.