Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Git commit to version output #5006

Closed
patrick-stephens opened this issue Mar 7, 2022 · 1 comment
Closed

Add Git commit to version output #5006

patrick-stephens opened this issue Mar 7, 2022 · 1 comment
Assignees

Comments

@patrick-stephens
Copy link
Contributor

patrick-stephens commented Mar 7, 2022

Is your feature request related to a problem? Please describe.
Provide the specific Git commit in the version output to simplify verification either automated or manual.

Describe the solution you'd like
Provide the Git commit information in the version string:

$ docker run --rm -it fluent/fluent-bit
Fluent Bit v1.8.13 (Git: 01ab9432e)
* Copyright (C) 2015-2021 The Fluent Bit Authors
...

Ideally we want to do this invisibly to the user, i.e. without having to provide another CMake argument which then requires multiple updates to all the build tooling and container definitions.
There are some examples that do this, e.g.:

Describe alternatives you've considered
Using FLB_NIGHTLY_BUILD unfortunately marks it as non-production when we want this info in production too.

Additional context
Related to #5002 but I would like to add some automated checks to verify the commit for a release/build.
This will also make it very easy to check the source commit in a container, package, etc. rather than rely on the semantic version string directly.

@patrick-stephens
Copy link
Contributor Author

$ docker run --rm -it ghcr.io/fluent/fluent-bit/master:x86_64
Unable to find image 'ghcr.io/fluent/fluent-bit/master:x86_64' locally
x86_64: Pulling from fluent/fluent-bit/master
2df365faf0e3: Already exists 
c6f4d1a13b69: Already exists 
a1f1879bb7de: Already exists 
32d197ce9bf9: Pull complete 
68153c429453: Pull complete 
e6fe30696e5c: Pull complete 
Digest: sha256:c617be1347521cd8082a2ce2c9c5dcae317fb489eb86412a0b5d55aeeba7f04f
Status: Downloaded newer image for ghcr.io/fluent/fluent-bit/master:x86_64
Fluent Bit v1.9.0
* Git commit: 1f3c282168ec0b8a6229b30f695730d6cb3771c7
* Copyright (C) 2015-2021 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2022/03/14 20:28:14] [ info] [engine] started (pid=1)

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

No branches or pull requests

1 participant