k3s/hack
Filipe Brandenburger de405ac126 Improve generation of version information from the git tree
Detect whether the tree is dirty and append a "-dirty" indication to the
git commit (common practice with other repos, e.g. kernel, docker.)

Properly handle the case where a git tree is not found (e.g. building
from archive.)

In the sed expression, look for the variable to be updated
(commitFromGit) instead of hardcoding a line number.

Tested:

- Built from a dirty tree:
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build 2d784c684c75-dirty

- Built from a clean tree:
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build 505f23a31172

- Built from an archive:
    $ hack/build-go.sh
    WARNING: unable to find git commit, falling back to commitFromGit = `(none)`
    $ output/go/bin/kubelet -version
    Kubernetes version 0.1, build (none)

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-07-30 18:48:57 -07:00
..
azure Rename and move Azure scripts. 2014-07-18 16:13:05 -07:00
e2e-suite Initial vagrant setup and e2e testing support 2014-07-24 16:32:36 -04:00
build-go.sh Remove cmd/integration from hack/build-go.sh 2014-07-28 14:46:28 -04:00
config-go.sh Use 'go install' to build all commands at the same time. 2014-07-27 22:20:13 -04:00
dev-build-and-push.sh Exit if release.sh has errors. 2014-07-28 15:24:07 -07:00
dev-build-and-up.sh Exit if release.sh has errors. 2014-07-28 15:24:07 -07:00
e2e-test.sh Add /version to server and check it in client. 2014-07-28 15:45:25 -07:00
install-std-race.sh -cover causes races in Go 1.2 2014-07-11 15:48:31 -04:00
integration-test.sh Use 'go install' to build all commands at the same time. 2014-07-27 22:20:13 -04:00
local-up-cluster.sh Merge pull request #643 from zhgwenming/build 2014-07-28 11:44:05 -07:00
test-cmd.sh Handle -version flag on all commands 2014-07-30 18:48:56 -07:00
test-go.sh The quotes around the file should not be necessary 2014-07-25 13:11:45 -04:00
verify-boilerplate.sh Make boilerplate hook work for .sh files, too. 2014-06-25 17:11:48 -07:00
verify-gofmt.sh Disable gofmt for non go1.2 or go1.3 2014-07-01 11:25:59 -07:00
version-gen.sh Improve generation of version information from the git tree 2014-07-30 18:48:57 -07:00