Capture git export-subst strings in version.sh for 'git archive' use.

Eliminate the need to update pkg/version/base.go on release branch tagging.

Kubernetes-commit: b356c6968d63bce3640d9f931843da83757bd8f4
This commit is contained in:
David McMahon
2017-11-08 15:37:49 -08:00
committed by Kubernetes Publisher
parent 584b13d350
commit 802f4da84a

View File

@@ -51,9 +51,13 @@ var (
// semantic version is a git hash, but the version itself is no
// longer the direct output of "git describe", but a slight
// translation to be semver compliant.
// NOTE: The $Format strings are replaced during 'git archive' thanks to the
// companion .gitattributes file containing 'export-subst' in this same
// directory. See also https://git-scm.com/docs/gitattributes
gitVersion string = "v1.8.4-beta.0+$Format:%h$"
gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD)
gitTreeState string = "not a git tree" // state of git tree, either "clean" or "dirty"
gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD)
gitTreeState string = "" // state of git tree, either "clean" or "dirty"
buildDate string = "1970-01-01T00:00:00Z" // build date in ISO8601 format, output of $(date -u +'%Y-%m-%dT%H:%M:%SZ')
)