diff --git a/Makefile b/Makefile index 5b737ed..889855a 100644 --- a/Makefile +++ b/Makefile @@ -14,13 +14,16 @@ # limitations under the License. # +VERSION_GIT := $(shell git describe --tags) +VERSION ?= ${VERSION_GIT} + kubesql_cmd := $(wildcard ./cmd/*.go) kubesql_pkg := $(wildcard ./pkg/cmd/*.go) all: kubectl-sql kubectl-sql: $(kubesql_cmd) $(kubesql_pkg) - go build -o kubectl-sql $(kubesql_cmd) + go build -ldflags='-X github.com/yaacov/kubesql/pkg/cmd.clientVersion=${VERSION}' -o kubectl-sql $(kubesql_cmd) .PHONY: lint lint: diff --git a/kubesql.spec b/kubesql.spec index 06e8e1a..7ac43df 100644 --- a/kubesql.spec +++ b/kubesql.spec @@ -30,7 +30,7 @@ kubectl-sql let you select Kubernetes resources based on the value of one or mor mkdir -p ./_build/src/github.com/yaacov ln -s $(pwd) ./_build/src/github.com/yaacov/kubesql -make +VERSION=%{version} make %install install -d %{buildroot}%{_bindir} diff --git a/pkg/cmd/sql.go b/pkg/cmd/sql.go index 62cf880..359b3c2 100644 --- a/pkg/cmd/sql.go +++ b/pkg/cmd/sql.go @@ -34,7 +34,7 @@ import ( ) var ( - clientVersion = "v0.2.1" + clientVersion = "master" sqlGetLong = `Uses SQL-like language to filter and display one or many resources.