feat(version): bake release tag into binary; About card and /health field
Release / build-and-push (push) Successful in 3m1s
Release / build-and-push (push) Successful in 3m1s
The version tag previously existed only in git and the Docker image tag — the running app had no way to report what build it was. Version is now injected at build time via -ldflags into internal/version.Version (defaults to "dev" for local builds), passed by the release workflow as the APP_VERSION Docker build arg from the pushed tag. Surfaced in Admin → Settings → About (extensible card for future rows like disk space) and in the /health JSON response, so deployments can be verified with curl alone.
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"bookhoard/internal/handlers"
|
||||
"bookhoard/internal/services"
|
||||
"bookhoard/internal/utils"
|
||||
"bookhoard/internal/version"
|
||||
"bookhoard/templates"
|
||||
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
@@ -1455,6 +1456,7 @@ func (cfg *Config) GetHealth(c *echo.Context) error {
|
||||
|
||||
return c.JSON(http.StatusOK, map[string]interface{}{
|
||||
"status": "healthy",
|
||||
"version": version.Version,
|
||||
"database": "connected",
|
||||
"scan": map[string]interface{}{
|
||||
"scan_in_progress": cfg.Worker.HasActiveScans(),
|
||||
|
||||
Reference in New Issue
Block a user