More experiments with flow id
This commit is contained in:
parent
a8516ec538
commit
cb70183b03
|
|
@ -155,11 +155,9 @@ var buildTarget = "compile"
|
|||
{
|
||||
Parallel.ForEach(batch.ToArray(), new ParallelOptions { MaxDegreeOfParallelism = threads }, repo =>
|
||||
{
|
||||
var blockName = string.Format("Building {0}", repo);
|
||||
|
||||
if (blockLogger != null)
|
||||
if (IsTeamCity)
|
||||
{
|
||||
blockLogger.StartBlock(blockName);
|
||||
Console.WriteLine(string.Format("##teamcity[blockOpened name='{0}' flowId='KOREBUILD_{0}']", repo));
|
||||
}
|
||||
|
||||
if (!IsLinux)
|
||||
|
|
@ -174,45 +172,46 @@ var buildTarget = "compile"
|
|||
try
|
||||
{
|
||||
Exec(CreateBuildWithFlowId(repo), buildTarget, repo);
|
||||
var repoArtifacts = Path.Combine(repo, "artifacts");
|
||||
var repoBuild = Path.Combine(repoArtifacts, "build");
|
||||
if (Directory.Exists(repoBuild))
|
||||
{
|
||||
foreach (var source in Directory.EnumerateFiles(repoBuild, "*.nupkg"))
|
||||
{
|
||||
File.Copy(source, Path.Combine(universeBuild, Path.GetFileName(source)), overwrite: true);
|
||||
}
|
||||
|
||||
if (Environment.GetEnvironmentVariable("KOREBUILD_ADD_ASSEMBLY_INFO") == "1")
|
||||
{
|
||||
var commitFile = Path.Combine(repoArtifacts, "commit");
|
||||
if (!File.Exists(commitFile))
|
||||
{
|
||||
throw new FileNotFoundException("Couldn't find the commit file for " + repo + ": " + commitFile);
|
||||
}
|
||||
|
||||
commits.TryAdd(repo, File.ReadAllLines(commitFile)[0]);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(ciVolatileShare))
|
||||
{
|
||||
Log.Info("Publishing packages to " + ciVolatileShare);
|
||||
NuGetPackagesAdd(repoBuild, ciVolatileShare);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Info(string.Format("Build {0} succeeded", repo));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Error("Building '" + repo + "' failed: " + ex);
|
||||
throw;
|
||||
}
|
||||
|
||||
var repoArtifacts = Path.Combine(repo, "artifacts");
|
||||
var repoBuild = Path.Combine(repoArtifacts, "build");
|
||||
if (Directory.Exists(repoBuild))
|
||||
finally
|
||||
{
|
||||
foreach (var source in Directory.EnumerateFiles(repoBuild, "*.nupkg"))
|
||||
if (IsTeamCity)
|
||||
{
|
||||
File.Copy(source, Path.Combine(universeBuild, Path.GetFileName(source)), overwrite: true);
|
||||
Console.WriteLine(string.Format("##teamcity[blockClosed name='{0}' flowId='KOREBUILD_{0}']", repo));
|
||||
}
|
||||
|
||||
if (Environment.GetEnvironmentVariable("KOREBUILD_ADD_ASSEMBLY_INFO") == "1")
|
||||
{
|
||||
var commitFile = Path.Combine(repoArtifacts, "commit");
|
||||
if (!File.Exists(commitFile))
|
||||
{
|
||||
throw new FileNotFoundException("Couldn't find the commit file for " + repo + ": " + commitFile);
|
||||
}
|
||||
|
||||
commits.TryAdd(repo, File.ReadAllLines(commitFile)[0]);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(ciVolatileShare))
|
||||
{
|
||||
Log.Info("Publishing packages to " + ciVolatileShare);
|
||||
NuGetPackagesAdd(repoBuild, ciVolatileShare);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Info(string.Format("Build {0} succeeded", repo));
|
||||
|
||||
if (blockLogger != null)
|
||||
{
|
||||
blockLogger.EndBlock(blockName);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue