Merge pull request #825 from ehazlett/git-commit-version

Git commit version info
This commit is contained in:
Evan Hazlett 2015-03-21 22:30:55 -04:00
commit 5c5fc37bc5
5 changed files with 13 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import (
log "github.com/Sirupsen/logrus"
"github.com/codegangsta/cli"
"github.com/docker/machine/utils"
"github.com/docker/machine/version"
)
func main() {
@ -28,7 +29,7 @@ func main() {
app.Commands = Commands
app.CommandNotFound = cmdNotFound
app.Usage = "Create and manage machines running Docker."
app.Version = VERSION
app.Version = version.VERSION + " (" + version.GITCOMMIT + ")"
app.Flags = []cli.Flag{
cli.BoolFlag{

View File

@ -15,4 +15,4 @@ fi
docker build -t docker-machine .
rm -f docker-machine*
exec docker run --rm -v `pwd`:/go/src/github.com/docker/machine docker-machine gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" -output="docker-machine_{{.OS}}-{{.Arch}}"
exec docker run --rm -v `pwd`:/go/src/github.com/docker/machine docker-machine gox "${OS_PLATFORM_ARG[@]}" "${OS_ARCH_ARG[@]}" -output="docker-machine_{{.OS}}-{{.Arch}}" -ldflags="-w -X github.com/docker/machine/version.GITCOMMIT `git rev-parse --short HEAD`"

View File

@ -1,3 +0,0 @@
package main
const VERSION = "0.1.0"

9
version/version.go Normal file
View File

@ -0,0 +1,9 @@
package version
var (
// VERSION should be updated by hand at each release
VERSION = "0.1.0"
// GITCOMMIT will be overritten automatically by the build system
GITCOMMIT = "HEAD"
)

1
version/version_test.go Normal file
View File

@ -0,0 +1 @@
package version