feat: stamp the build version into every service
pkg/version.Version (default "dev") is set at link time via -ldflags from each service Dockerfile's VERSION build-arg, which the deploy passes as the git tag (git describe --tags). It surfaces as the OpenTelemetry service.version resource attribute (so Grafana/Tempo are version-aware), alongside the SPA's existing About version. Adds the VERSION build-arg to the backend/gateway/validator/bot compose builds and a serviceResource test covering service.name + service.version.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// Package version exposes the build version stamped into every Scrabble service
|
||||
// binary. The default is "dev"; release builds override it through the linker
|
||||
// (`go build -ldflags "-X scrabble/pkg/version.Version=<value>"`), wired from the
|
||||
// VERSION build-arg in each service Dockerfile, which the deploy sets to the git
|
||||
// tag (`git describe --tags`). It surfaces as the OpenTelemetry service.version
|
||||
// resource attribute (see pkg/telemetry) and the SPA About screen.
|
||||
package version
|
||||
|
||||
// Version is the build version, "dev" unless overridden at link time.
|
||||
var Version = "dev"
|
||||
Reference in New Issue
Block a user