OPC # 0006: OPC Git Trunk-Based management
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using ControlPlane.Core.Models;
|
||||
using ControlPlane.Core.Services;
|
||||
using LibGit2Sharp;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Diagnostics;
|
||||
@@ -24,9 +25,14 @@ public class ProjectBuildService(
|
||||
|
||||
return
|
||||
[
|
||||
new("Clarity.Server", BuildKind.DotnetProject, "Clarity.Server/Clarity.Server.csproj"),
|
||||
new("Clarity.ServiceDefaults", BuildKind.DotnetProject, "Clarity.ServiceDefaults/Clarity.ServiceDefaults.csproj"),
|
||||
new("frontend (Clarity.Server)", BuildKind.NpmProject, "frontend"),
|
||||
// ── Solution-level builds (primary targets) ──────────────────────
|
||||
new("Clarity Solution", BuildKind.SolutionBuild, "Clarity/Clarity.slnx"),
|
||||
new("ControlPlane Solution", BuildKind.SolutionBuild, "OPC/ControlPlane.slnx"),
|
||||
|
||||
// ── Individual Clarity projects ───────────────────────────────────
|
||||
new("Clarity.Server", BuildKind.DotnetProject, "Clarity/Clarity.Server/Clarity.Server.csproj"),
|
||||
new("Clarity.ServiceDefaults", BuildKind.DotnetProject, "Clarity/Clarity.ServiceDefaults/Clarity.ServiceDefaults.csproj"),
|
||||
new("frontend (Clarity.Server)", BuildKind.NpmProject, "Clarity/frontend"),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -53,6 +59,16 @@ public class ProjectBuildService(
|
||||
record.Log.Add("──────────────────────────────────────");
|
||||
onLine($"▶ Building {def.Name}");
|
||||
|
||||
// Capture HEAD SHA so the build is traceable to a specific commit
|
||||
try
|
||||
{
|
||||
using var gitRepo = new Repository(RepoRoot);
|
||||
record.CommitSha = gitRepo.Head.Tip?.Sha;
|
||||
if (record.CommitSha is not null)
|
||||
record.Log.Add($" Commit: {record.CommitSha[..8]}");
|
||||
}
|
||||
catch { /* not a git repo or no commits yet */ }
|
||||
|
||||
try
|
||||
{
|
||||
var (exe, args, workDir) = def.Kind == BuildKind.NpmProject
|
||||
|
||||
Reference in New Issue
Block a user