Skip to content

Commit

Permalink
Merge commit '33d58fdc29b90120bf16e536042379251f8631f2' into release-…
Browse files Browse the repository at this point in the history
…tools
  • Loading branch information
pohly committed Jan 25, 2019
2 parents 11ad2bd + 33d58fd commit 626dc11
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions release-tools/build.make
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,15 @@ IMAGE_TAGS+=$(shell tagged="$$(git describe --tags --match='v*' --abbrev=0)"; if
IMAGE_NAME=$(REGISTRY_NAME)/$*

ifdef V
# Adding "-alsologtostderr" assumes that all test binaries contain glog. This is not guaranteed.
TESTARGS = -v -args -alsologtostderr -v 5
else
TESTARGS =
endif

# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
# to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below.

build-%:
mkdir -p bin
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-X main.version=$(REV) -extldflags "-static"' -o ./bin/$* ./cmd/$*
Expand All @@ -70,7 +74,7 @@ push-%: container-%
docker push $(IMAGE_NAME):$$tag; \
}; \
for tag in $(IMAGE_TAGS); do \
if echo $$tag | grep -q -e '-canary$$'; then \
if [ "$$tag" = "canary" ] || echo "$$tag" | grep -q -e '-canary$$'; then \
: "creating or overwriting canary image"; \
push_image; \
elif docker pull $(IMAGE_NAME):$$tag 2>&1 | tee /dev/stderr | grep -q "manifest for $(IMAGE_NAME):$$tag not found"; then \
Expand All @@ -93,20 +97,20 @@ test:
.PHONY: test-go
test: test-go
test-go:
@ echo; echo $@
go test `go list ./... | grep -v 'vendor'` $(TESTARGS)
@ echo; echo "### $@:"
go test `go list ./... | grep -v 'vendor' $(TEST_GO_FILTER_CMD)` $(TESTARGS)

.PHONY: test-vet
test: test-vet
test-vet:
@ echo; echo $@
go vet `go list ./... | grep -v vendor`
@ echo; echo "### $@:"
go vet `go list ./... | grep -v vendor $(TEST_VET_FILTER_CMD)`

.PHONY: test-fmt
test: test-fmt
test-fmt:
@ echo; echo $@
files=$$(find . -name '*.go' | grep -v './vendor'); \
@ echo; echo "### $@:"
files=$$(find . -name '*.go' | grep -v './vendor' $(TEST_FMT_FILTER_CMD)); \
if [ $$(gofmt -d $$files | wc -l) -ne 0 ]; then \
echo "formatting errors:"; \
gofmt -d $$files; \
Expand All @@ -116,5 +120,5 @@ test-fmt:
.PHONY: test-subtree
test: test-subtree
test-subtree:
@ echo; echo $@
@ echo; echo "### $@:"
./release-tools/verify-subtree.sh release-tools

0 comments on commit 626dc11

Please sign in to comment.