Skip to content

Commit

Permalink
Capture git export-subst strings in version.sh for 'git archive' use.
Browse files Browse the repository at this point in the history
Eliminate the need to update pkg/version/base.go on release branch tagging.

Kubernetes-commit: 9a9d11bb75010f43d771bf0449d462bc153760ce
  • Loading branch information
david-mcmahon authored and k8s-publish-robot committed Nov 8, 2017
1 parent 70172e9 commit 8dc3cca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/version/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "v0.0.0-master+$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')
)

0 comments on commit 8dc3cca

Please sign in to comment.