Phase 5: scaffold Crucible (sow-tools) — dispatcher + builder shims, container, PR-first CI, fail-closed (D11, D19).
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// Package buildinfo reports the Crucible build version.
|
||||
//
|
||||
// Version is empty in plain `go build`; the build scripts and Dockerfile inject
|
||||
// the short git sha via -ldflags. As a fallback we read the VCS revision that
|
||||
// the Go toolchain stamps into the binary, so a binary built without -ldflags
|
||||
// still self-identifies.
|
||||
package buildinfo
|
||||
|
||||
import "runtime/debug"
|
||||
|
||||
// Version is overridable at link time:
|
||||
//
|
||||
// -ldflags "-X gitea.westgate.pw/ShadowsOverWestgate/sow-tools/internal/buildinfo.Version=<sha>"
|
||||
var Version = ""
|
||||
|
||||
// String returns a human-readable version line, e.g. "crucible 8f31c2a".
|
||||
func String() string {
|
||||
return "crucible " + revision()
|
||||
}
|
||||
|
||||
func revision() string {
|
||||
if Version != "" {
|
||||
return Version
|
||||
}
|
||||
if bi, ok := debug.ReadBuildInfo(); ok {
|
||||
for _, s := range bi.Settings {
|
||||
if s.Key == "vcs.revision" && s.Value != "" {
|
||||
return s.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
return "devel"
|
||||
}
|
||||
Reference in New Issue
Block a user