Add containerdVersion flag

Add version flag that only prints the static version for the binary.

This commit does not include build details for containers since
Makefile does not build them.

Closes #8

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
This commit is contained in:
Christopher M. Luciano
2017-04-18 15:07:00 -04:00
parent d6978e3b7f
commit 683fd7f0e5
5 changed files with 98 additions and 2 deletions

View File

@@ -17,6 +17,9 @@ EPOCH_TEST_COMMIT ?= f9e02affccd51702191e5312665a16045ffef8ab
PROJECT := github.com/kubernetes-incubator/cri-containerd
BINDIR ?= ${DESTDIR}/usr/local/bin
BUILD_DIR ?= _output
# VERSION is the version of the binary.
VERSION:=$(shell git describe --tags --dirty)
BUILD_TAGS:= -ldflags '-X $(PROJECT)/pkg/version.criContainerdVersion=$(VERSION)'
all: binaries
@@ -32,6 +35,7 @@ help:
@echo " * 'verify' - Execute the source code verification tools"
@echo " * 'install.tools' - Installs tools used by verify"
@echo " * 'uninstall' - Remove installed binaries from system locations"
@echo " * 'version' - Print current cri-containerd release version"
.PHONY: check-gopath
@@ -42,6 +46,9 @@ endif
verify: lint gofmt boiler
version:
@echo $(VERSION)
lint: check-gopath
@echo "checking lint"
@./hack/lint.sh
@@ -56,7 +63,8 @@ boiler:
cri-containerd: check-gopath
$(GO) build -o $(BUILD_DIR)/$@ \
$(PROJECT)/cmd/cri-containerd
$(BUILD_TAGS) \
$(PROJECT)/cmd/cri-containerd
test:
go test -timeout=1m -v -race ./pkg/... $(BUILD_TAGS)
@@ -102,4 +110,5 @@ install.tools: .install.gitvalidation .install.gometalinter
help \
install \
lint \
uninstall
uninstall \
version