mirror of https://github.com/docker/docs.git
Merge pull request #825 from ehazlett/git-commit-version
Git commit version info
This commit is contained in:
commit
5c5fc37bc5
3
main.go
3
main.go
|
@ -7,6 +7,7 @@ import (
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/docker/machine/utils"
|
"github.com/docker/machine/utils"
|
||||||
|
"github.com/docker/machine/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -28,7 +29,7 @@ func main() {
|
||||||
app.Commands = Commands
|
app.Commands = Commands
|
||||||
app.CommandNotFound = cmdNotFound
|
app.CommandNotFound = cmdNotFound
|
||||||
app.Usage = "Create and manage machines running Docker."
|
app.Usage = "Create and manage machines running Docker."
|
||||||
app.Version = VERSION
|
app.Version = version.VERSION + " (" + version.GITCOMMIT + ")"
|
||||||
|
|
||||||
app.Flags = []cli.Flag{
|
app.Flags = []cli.Flag{
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
|
|
|
@ -15,4 +15,4 @@ fi
|
||||||
|
|
||||||
docker build -t docker-machine .
|
docker build -t docker-machine .
|
||||||
rm -f 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"
|
|
|
@ -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"
|
||||||
|
)
|
|
@ -0,0 +1 @@
|
||||||
|
package version
|
Loading…
Reference in New Issue