Merge pull request #423 from kadel/fix-version-gitcommit

fix passing gitcommit in version output
This commit is contained in:
Charlie Drage 2017-02-11 18:41:27 -05:00 committed by GitHub
commit f918d51cc1
2 changed files with 4 additions and 2 deletions

View File

@ -15,7 +15,7 @@
GITCOMMIT := $(shell git rev-parse --short HEAD) GITCOMMIT := $(shell git rev-parse --short HEAD)
BUILD_FLAGS := -ldflags="-w -X github.com/kubernetes-incubator/kompose/version.GITCOMMIT=$(GITCOMMIT)" BUILD_FLAGS := -ldflags="-w -X github.com/kubernetes-incubator/kompose/cmd.GITCOMMIT=$(GITCOMMIT)"
PKGS := $(shell glide novendor) PKGS := $(shell glide novendor)
TEST_IMAGE := kompose/tests:latest TEST_IMAGE := kompose/tests:latest

View File

@ -26,7 +26,9 @@ var (
// VERSION is version number that wil be displayed when running ./kompose version // VERSION is version number that wil be displayed when running ./kompose version
VERSION = "0.2.0" VERSION = "0.2.0"
// GITCOMMIT is hash of the commit that wil be displayed when running ./kompose version // GITCOMMIT is hash of the commit that wil be displayed when running ./kompose version
GITCOMMIT = "64433fd" // this will be overwritten when running build like this: go build -ldflags="-X github.com/kubernetes-incubator/kompose/cmd.GITCOMMIT=$(GITCOMMIT)"
// HEAD is default indicating that this was not set during build
GITCOMMIT = "HEAD"
) )
// versionCmd represents the version command // versionCmd represents the version command