feat(build-info): embed version, git hash, and build date in binaries #9

Merged
nrupard merged 1 commit from feat/build-info-version into main 2026-05-08 03:48:01 +02:00
Owner

Add a workspace crate meshcentral-build-info with a build script that emits compile-time constants for the application version, git commit, and UTC build timestamp. Each value can be overridden by VERVAIN_BUILD_VERSION, VERVAIN_BUILD_GIT_HASH, or VERVAIN_BUILD_DATE; otherwise the build script falls back to git describe --tags --always --dirty, git rev-parse HEAD, and the current UTC time.

Wire the constants into the meshcentral and meshctrl clap definitions so --version prints a multi-line banner with all three fields, into the meshcentral version subcommand, and into the server startup log line.

Plumb the three env vars into oci-build/Dockerfile as build args, since the production image build context does not include the .git directory and the build script cannot derive the values inside the builder stage on its own.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Add a workspace crate `meshcentral-build-info` with a build script that emits compile-time constants for the application version, git commit, and UTC build timestamp. Each value can be overridden by `VERVAIN_BUILD_VERSION`, `VERVAIN_BUILD_GIT_HASH`, or `VERVAIN_BUILD_DATE`; otherwise the build script falls back to `git describe --tags --always --dirty`, `git rev-parse HEAD`, and the current UTC time. Wire the constants into the `meshcentral` and `meshctrl` clap definitions so `--version` prints a multi-line banner with all three fields, into the `meshcentral version` subcommand, and into the server startup log line. Plumb the three env vars into `oci-build/Dockerfile` as build args, since the production image build context does not include the .git directory and the build script cannot derive the values inside the builder stage on its own. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat(build-info): embed version, git hash, and build date in binaries
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
57849fcca2
Add a workspace crate `meshcentral-build-info` with a build script that emits compile-time constants for the application version, git commit, and UTC build timestamp. Each value can be overridden by `VERVAIN_BUILD_VERSION`, `VERVAIN_BUILD_GIT_HASH`, or `VERVAIN_BUILD_DATE`; otherwise the build script falls back to `git describe --tags --always --dirty`, `git rev-parse HEAD`, and the current UTC time.

Wire the constants into the `meshcentral` and `meshctrl` clap definitions so `--version` prints a multi-line banner with all three fields, into the `meshcentral version` subcommand, and into the server startup log line.

Plumb the three env vars into `oci-build/Dockerfile` as build args, since the production image build context does not include the .git directory and the build script cannot derive the values inside the builder stage on its own.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nrupard deleted branch feat/build-info-version 2026-05-08 03:48:01 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-server!9
No description provided.