OPC # 0006: OPC Git Trunk-Based management

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
amadzarak
2026-04-26 00:26:56 -04:00
parent 885ad47abe
commit db025cce01
7 changed files with 1238 additions and 349 deletions
@@ -2,6 +2,7 @@ using ControlPlane.Core.Models;
using ControlPlane.Core.Services;
using Docker.DotNet;
using Docker.DotNet.Models;
using LibGit2Sharp;
namespace ControlPlane.Api.Services;
@@ -49,6 +50,14 @@ public class ImageBuildService(
var record = await history.CreateBuildAsync(BuildKind.DockerImage, ImageName);
// Capture HEAD SHA so the build is traceable back to a specific commit
try
{
using var repo = new Repository(repoRoot);
record.CommitSha = repo.Head.Tip?.Sha;
}
catch { /* not a git repo or no commits yet — CommitSha stays null */ }
try
{
var socketUri = config["Docker:Socket"] ?? "npipe://./pipe/docker_engine";