-
Notifications
You must be signed in to change notification settings - Fork 91
Include GIT SHA in the binary builds #169
Comments
Do you use go codegen or a bash script for this? |
It's in our makefile. We use the ldflags during go build. No scripts or code gen needed. |
I see. I can write a bazel script to fill up a go source file. go tool would use the default values then. |
Well we need to have a go file like the one mentioned above https://github.com/amalgam8/amalgam8/blob/master/pkg/version/version.go |
Do we need to write a Go file ? Cant we make bazel include ldflags ? go build |
basically we just include the same version file in our code. Populate the vars at compile time (as shown above), stick them into ldflags and compile. |
go_binary's linkstamp attribute may be of some use here.
|
Implemented in #265 |
Sometimes, its hard to identify if Bazel built the binary or not.. It would be nice to include all the git commit versions into the binary so that we can be sure that it is using the current version.
For example, in amalgam8 we use something like this:
We need an equivalent in bazel. Could someone help with this please?
The text was updated successfully, but these errors were encountered: