Skip to content

Stamp build identity into do-obsd via ldflags#28

Open
jnaidu-do wants to merge 3 commits intomainfrom
jnaidu/IN-7091
Open

Stamp build identity into do-obsd via ldflags#28
jnaidu-do wants to merge 3 commits intomainfrom
jnaidu/IN-7091

Conversation

@jnaidu-do
Copy link
Copy Markdown
Collaborator

@jnaidu-do jnaidu-do commented May 4, 2026

Summary

  • Bake the binary's version into do-obsd via -ldflags "-X main.version=$(VERSION)". revision and buildDate come from runtime/debug.ReadBuildInfo() (auto VCS embed; no extra ldflags).
  • Add a -version CLI flag and enrich the startup slog line so a running supervisor self-identifies (version, revision, buildDate, goVersion).
  • Symlink /usr/bin/do-obsd → /opt/digitalocean/bin/do-obsd in the post-install scriptlet so operators can run do-obsd -version from PATH; cleaned up on uninstall.
  • Makefile gets a VERSION ?= override hook for the cthulhu release pipeline, plus -s -w and -trimpath to align with what CI was already doing.

Test

  • Verified by deploying the build on a droplet and executing --version command
Screenshot 2026-05-04 at 8 16 33 PM

@jnaidu-do jnaidu-do requested a review from a team May 4, 2026 11:22
@jnaidu-do jnaidu-do changed the title Jnaidu/in 7091 Stamp build identity into do-obsd via ldflags May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant