-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
include commit in pre-release builds #988
include commit in pre-release builds #988
Conversation
later we'll also use this in kubernetes CI to record the kind commit used to test. |
/cc @amwat
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amwat, BenTheElder The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
v += "-" + VersionPreRelease | ||
// if commit was set, add the + <build> | ||
// we only do this for pre-release versions | ||
if GitCommit != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to consider in a follow-up: we might want to instead (or additionally) have the release scripts to export COMMIT=""
to make it easier to reproducibly build the binaries from a source tarball. or instructions for doing COMMIT=<release-commit> make build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is probably better to include the commit, and then if someone wants to reproduce the binaries without git they can set COMMIT=
(the makefile should already support this)
@@ -28,6 +28,9 @@ INSTALL?=install | |||
# make install will place binaries here | |||
# the default path attempts to mimic go install | |||
INSTALL_DIR?=$(shell hack/build/goinstalldir.sh) | |||
# record the source commit in the binary | |||
COMMIT?=$(shell git rev-parse HEAD 2>/dev/null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not the short commit id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's easier to read imho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The short version is just this truncated. We can truncate at runtime when formatting if we want, but this is the correct unambiguous commit ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xref: #986