Add build tags and Improve the test case of selinux

- Add build tags
- Fixes a bug because of my negligence
- Improve the test case of selinux

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

test
This commit is contained in:
Yanqiang Miao
2017-09-05 15:40:06 +08:00
parent 3647ff5976
commit 7096027d21
3 changed files with 23 additions and 13 deletions

View File

@@ -24,7 +24,10 @@ VERSION := $(shell git describe --tags --dirty)
# strip the first char of the tag if it's a `v`
VERSION := $(VERSION:v%=%)
TARBALL ?= cri-containerd-$(VERSION).tar.gz
BUILD_TAGS:= -ldflags '-X $(PROJECT)/pkg/version.criContainerdVersion=$(VERSION)'
ifdef BUILD_TAGS
BUILD_TAGS := -tags $(BUILD_TAGS)
endif
GO_LDFLAGS := -ldflags '-X $(PROJECT)/pkg/version.criContainerdVersion=$(VERSION)'
SOURCES := $(shell find . -name '*.go')
all: binaries
@@ -68,8 +71,7 @@ boiler:
$(BUILD_DIR)/cri-containerd: $(SOURCES)
$(GO) build -o $@ \
$(BUILD_TAGS) \
$(GO_LDFLAGS) $(GO_GCFLAGS) \
$(BUILD_TAGS) $(GO_LDFLAGS) $(GO_GCFLAGS) \
$(PROJECT)/cmd/cri-containerd
test:
@@ -86,7 +88,7 @@ clean:
binaries: $(BUILD_DIR)/cri-containerd
static-binaries: GO_LDFLAGS=--ldflags '-extldflags "-fno-PIC -static"'
static-binaries: GO_LDFLAGS += --ldflags '-extldflags "-fno-PIC -static"'
static-binaries: $(BUILD_DIR)/cri-containerd
install: binaries