Stamp shared build metadata into banger binaries
Treat `banger`, `bangerd`, and `banger-vsock-agent` as one release by stamping the same version, commit SHA, and build timestamp into every binary through a shared ldflag-backed `internal/buildinfo` package. Add `banger version`, extend daemon ping/status to report the running daemon's build tuple, and keep the guest helper linked to the same build metadata without adding a new public version surface for it. Validate with `GOCACHE=/tmp/banger-gocache go test ./...`, `make build`, `./build/bin/banger version`, and `./build/bin/banger daemon status` after the daemon restarts onto the new binary.
This commit is contained in:
parent
ea2db1e868
commit
f798e1db33
9 changed files with 219 additions and 13 deletions
|
|
@ -11,12 +11,15 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"banger/internal/buildinfo"
|
||||
sdkvsock "github.com/firecracker-microvm/firecracker-go-sdk/vsock"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"banger/internal/vsockagent"
|
||||
)
|
||||
|
||||
var _, _, _ = buildinfo.Version, buildinfo.Commit, buildinfo.BuiltAt
|
||||
|
||||
func main() {
|
||||
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||
defer cancel()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue