fix passing gitcommit in version output

This commit is contained in:
Tomas Kral 2017-02-11 17:05:08 +01:00
parent be042c7e1f
commit 18955c63d4
No known key found for this signature in database
GPG Key ID: E690DA7E4F291FA6
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