Move version information to separate file

Moves the version information to a seperate file. This is mostly due to
import cycle errors occuring when using "import
github.com/kubernetes/kompose/cmd" in order to get the global variable
of VERSION and GITCOMMIT.

Update's the Makefile and other files accordingly.

If the version and commmit is unretriveable due to not being able to
find the kompose binary, the one from pkg/version/version.go will be
used.
This commit is contained in:
Charlie Drage
2017-11-07 15:28:04 -05:00
parent fe62a96465
commit 0f4bfebf08
5 changed files with 26 additions and 15 deletions
+10
View File
@@ -0,0 +1,10 @@
package version
var (
// VERSION is version number that wil be displayed when running ./kompose version
VERSION = "1.4.0"
// GITCOMMIT is hash of the commit that wil be displayed when running ./kompose version
// this will be overwritten when running build like this: go build -ldflags="-X github.com/kubernetes/kompose/pkg/version.GITCOMMIT=$(GITCOMMIT)"
// HEAD is default indicating that this was not set during build
GITCOMMIT = "HEAD"
)