Publish the image on version tags and test what is delivered

A v* tag now builds, tries and publishes the image: the version must be the
one of Directory.Build.props, latest only moves forward and the registry
token is in one step, given to docker on its input. The same script works by
hand. The image says its version and commit, and its health check also
covers the engine loop and the live prices.

The Unraid template is final: a test compares it with appendix E and with
the variables the loader really reads, and another reads the workflow.

refs #70
refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-01 19:21:40 +01:00
1 parent 4d92a39fef
commit 3cd214ae78
16 files changed
+859 -27

No files matched your search

+30 -4
View File
@@ -82,7 +82,35 @@ int GuardDrill(string tag) =>
int BuildImage(string tag) =>
Step("Costruzione dell'immagine Docker", "docker",
["build", "-f", "deploy/docker/Dockerfile", "-t", $"gitea.encke-hake.ts.net/balbosoft/anubis:{tag}", "."]) ?? 0;
["build", "-f", "deploy/docker/Dockerfile", "--build-arg", $"ANUBIS_VERSION={tag}", "--build-arg", $"ANUBIS_COMMIT={Commit()}",
"-t", $"gitea.encke-hake.ts.net/balbosoft/anubis:{tag}", "."]) ?? 0;
// The commit written in the image, so a diagnostics report says which code it comes from; empty without git.
string Commit()
{
var info = new ProcessStartInfo("git") { WorkingDirectory = root, UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true };
info.ArgumentList.Add("rev-parse");
info.ArgumentList.Add("HEAD");
try
{
using var git = Process.Start(info)!;
var commit = git.StandardOutput.ReadToEnd().Trim();
git.WaitForExit();
return git.ExitCode == 0 ? commit : "";
}
catch (System.ComponentModel.Win32Exception)
{
return "";
}
}
// The version of Directory.Build.props, the only place where it is written.
string Version()
{
var props = File.ReadAllText(Path.Combine(root, "Directory.Build.props"));
var start = props.IndexOf("<Version>", StringComparison.Ordinal) + "<Version>".Length;
return props[start..props.IndexOf("</Version>", start, StringComparison.Ordinal)];
}
// Demo data photographed at 1440 and 390 pixels, light and dark, to compare with docs/design (SPEC 13.1). Uses the
// Edge or Chrome already on the computer, driven through its DevTools protocol: nothing to install (ADR 0007).
@@ -188,9 +216,7 @@ static int FreePort()
// the Phase 10 installer exists. It needs the ASP.NET Core 10 runtime on the computer.
int ReleaseWindows()
{
var props = File.ReadAllText(Path.Combine(root, "Directory.Build.props"));
var start = props.IndexOf("<Version>", StringComparison.Ordinal) + "<Version>".Length;
var version = props[start..props.IndexOf("</Version>", start, StringComparison.Ordinal)];
var version = Version();
var name = $"anubis-{version}-win-x64";
var output = Path.Combine(root, "artifacts", "release");
var folder = Path.Combine(output, name);