mirror of
https://github.com/docker/docs.git
synced 2026-11-05 00:14:17 +03:00
add git commit to version info
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
3
main.go
3
main.go
@@ -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{
|
||||
|
||||
@@ -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`"
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
package main
|
||||
|
||||
const VERSION = "0.1.0"
|
||||
9
version/version.go
Normal file
9
version/version.go
Normal 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
1
version/version_test.go
Normal file
@@ -0,0 +1 @@
|
||||
package version
|
||||
Reference in New Issue
Block a user