More experiments with flow id

This commit is contained in:
Pranav K 2016-04-01 06:38:08 -07:00
parent a8516ec538
commit cb70183b03
1 changed files with 58 additions and 59 deletions

View File

@ -155,11 +155,9 @@ var buildTarget = "compile"
{ {
Parallel.ForEach(batch.ToArray(), new ParallelOptions { MaxDegreeOfParallelism = threads }, repo => Parallel.ForEach(batch.ToArray(), new ParallelOptions { MaxDegreeOfParallelism = threads }, repo =>
{ {
var blockName = string.Format("Building {0}", repo); if (IsTeamCity)
if (blockLogger != null)
{ {
blockLogger.StartBlock(blockName); Console.WriteLine(string.Format("##teamcity[blockOpened name='{0}' flowId='KOREBUILD_{0}']", repo));
} }
if (!IsLinux) if (!IsLinux)
@ -174,13 +172,6 @@ var buildTarget = "compile"
try try
{ {
Exec(CreateBuildWithFlowId(repo), buildTarget, repo); Exec(CreateBuildWithFlowId(repo), buildTarget, repo);
}
catch (Exception ex)
{
Log.Error("Building '" + repo + "' failed: " + ex);
throw;
}
var repoArtifacts = Path.Combine(repo, "artifacts"); var repoArtifacts = Path.Combine(repo, "artifacts");
var repoBuild = Path.Combine(repoArtifacts, "build"); var repoBuild = Path.Combine(repoArtifacts, "build");
if (Directory.Exists(repoBuild)) if (Directory.Exists(repoBuild))
@ -209,10 +200,18 @@ var buildTarget = "compile"
} }
Log.Info(string.Format("Build {0} succeeded", repo)); Log.Info(string.Format("Build {0} succeeded", repo));
}
if (blockLogger != null) catch (Exception ex)
{ {
blockLogger.EndBlock(blockName); Log.Error("Building '" + repo + "' failed: " + ex);
throw;
}
finally
{
if (IsTeamCity)
{
Console.WriteLine(string.Format("##teamcity[blockClosed name='{0}' flowId='KOREBUILD_{0}']", repo));
}
} }
}); });
} }