Merge pull request #918 from sargun/remove-q
Remove $Q Makefile command surpression
This commit is contained in:
50
Makefile
50
Makefile
@@ -19,7 +19,7 @@ goreleaser := github.com/goreleaser/goreleaser@v0.82.2
|
|||||||
gox := github.com/mitchellh/gox@v1.0.1
|
gox := github.com/mitchellh/gox@v1.0.1
|
||||||
|
|
||||||
# comment this line out for quieter things
|
# comment this line out for quieter things
|
||||||
# V := 1 # When V is set, print commands and build progress.
|
# V := 1 # When V is set, try to enable extra logging for debugging
|
||||||
|
|
||||||
# Space separated patterns of packages to skip in list, test, format.
|
# Space separated patterns of packages to skip in list, test, format.
|
||||||
IGNORED_PACKAGES := /vendor/
|
IGNORED_PACKAGES := /vendor/
|
||||||
@@ -35,19 +35,19 @@ all: test build
|
|||||||
# safebuild builds inside a docker container with no clingons from your $GOPATH
|
# safebuild builds inside a docker container with no clingons from your $GOPATH
|
||||||
safebuild:
|
safebuild:
|
||||||
@echo "Building..."
|
@echo "Building..."
|
||||||
$Q docker build --build-arg BUILD_TAGS="$(VK_BUILD_TAGS)" -t $(DOCKER_IMAGE):$(VERSION) .
|
docker build --build-arg BUILD_TAGS="$(VK_BUILD_TAGS)" -t $(DOCKER_IMAGE):$(VERSION) .
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build: build_tags := netgo osusergo
|
build: build_tags := netgo osusergo
|
||||||
build: OUTPUT_DIR ?= bin
|
build: OUTPUT_DIR ?= bin
|
||||||
build: authors
|
build: authors
|
||||||
@echo "Building..."
|
@echo "Building..."
|
||||||
$Q CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o $(OUTPUT_DIR)/$(binary) $(if $V,-v) $(VERSION_FLAGS) ./cmd/$(binary)
|
CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o $(OUTPUT_DIR)/$(binary) $(if $V,-v) $(VERSION_FLAGS) ./cmd/$(binary)
|
||||||
|
|
||||||
.PHONY: tags
|
.PHONY: tags
|
||||||
tags:
|
tags:
|
||||||
@echo "Listing tags..."
|
@echo "Listing tags..."
|
||||||
$Q @git tag
|
@git tag
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: build goreleaser
|
release: build goreleaser
|
||||||
@@ -58,36 +58,36 @@ release: build goreleaser
|
|||||||
.PHONY: clean test list cover format docker
|
.PHONY: clean test list cover format docker
|
||||||
mod:
|
mod:
|
||||||
@echo "Prune Dependencies..."
|
@echo "Prune Dependencies..."
|
||||||
$Q go mod tidy
|
go mod tidy
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
@echo "Docker Build..."
|
@echo "Docker Build..."
|
||||||
$Q docker build --build-arg BUILD_TAGS="$(VK_BUILD_TAGS)" -t $(DOCKER_IMAGE) .
|
docker build --build-arg BUILD_TAGS="$(VK_BUILD_TAGS)" -t $(DOCKER_IMAGE) .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo "Clean..."
|
@echo "Clean..."
|
||||||
$Q rm -rf bin
|
rm -rf bin
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
@echo "go vet'ing..."
|
@echo "go vet'ing..."
|
||||||
ifndef CI
|
ifndef CI
|
||||||
@echo "go vet'ing Outside CI..."
|
@echo "go vet'ing Outside CI..."
|
||||||
$Q go vet $(allpackages)
|
go vet $(allpackages)
|
||||||
else
|
else
|
||||||
@echo "go vet'ing in CI..."
|
@echo "go vet'ing in CI..."
|
||||||
$Q mkdir -p test
|
mkdir -p test
|
||||||
$Q ( go vet $(allpackages); echo $$? ) | \
|
( go vet $(allpackages); echo $$? ) | \
|
||||||
tee test/vet.txt | sed '$$ d'; exit $$(tail -1 test/vet.txt)
|
tee test/vet.txt | sed '$$ d'; exit $$(tail -1 test/vet.txt)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test:
|
test:
|
||||||
ifndef CI
|
ifndef CI
|
||||||
@echo "Testing..."
|
@echo "Testing..."
|
||||||
$Q go test $(if $V,-v) $(allpackages)
|
go test $(if $V,-v) $(allpackages)
|
||||||
else
|
else
|
||||||
@echo "Testing in CI..."
|
@echo "Testing in CI..."
|
||||||
$Q mkdir -p test
|
mkdir -p test
|
||||||
$Q ( GODEBUG=cgocheck=2 go test -timeout=9m -v $(allpackages); echo $$? ) | \
|
( GODEBUG=cgocheck=2 go test -timeout=9m -v $(allpackages); echo $$? ) | \
|
||||||
tee test/output.txt | sed '$$ d'; exit $$(tail -1 test/output.txt)
|
tee test/output.txt | sed '$$ d'; exit $$(tail -1 test/output.txt)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -98,29 +98,29 @@ list:
|
|||||||
cover: gocovmerge
|
cover: gocovmerge
|
||||||
@echo "Coverage Report..."
|
@echo "Coverage Report..."
|
||||||
@echo "NOTE: make cover does not exit 1 on failure, don't use it to check for tests success!"
|
@echo "NOTE: make cover does not exit 1 on failure, don't use it to check for tests success!"
|
||||||
$Q rm -f .GOPATH/cover/*.out cover/all.merged
|
rm -f .GOPATH/cover/*.out cover/all.merged
|
||||||
$(if $V,@echo "-- go test -coverpkg=./... -coverprofile=cover/... ./...")
|
$(if $V,@echo "-- go test -coverpkg=./... -coverprofile=cover/... ./...")
|
||||||
@for MOD in $(allpackages); do \
|
@for MOD in $(allpackages); do \
|
||||||
go test -coverpkg=`echo $(allpackages)|tr " " ","` \
|
go test -coverpkg=`echo $(allpackages)|tr " " ","` \
|
||||||
-coverprofile=cover/unit-`echo $$MOD|tr "/" "_"`.out \
|
-coverprofile=cover/unit-`echo $$MOD|tr "/" "_"`.out \
|
||||||
$$MOD 2>&1 | grep -v "no packages being tested depend on"; \
|
$$MOD 2>&1 | grep -v "no packages being tested depend on"; \
|
||||||
done
|
done
|
||||||
$Q $(gobin_tool) -run $(gocovmerge) cover/*.out > cover/all.merged
|
$(gobin_tool) -run $(gocovmerge) cover/*.out > cover/all.merged
|
||||||
ifndef CI
|
ifndef CI
|
||||||
@echo "Coverage Report..."
|
@echo "Coverage Report..."
|
||||||
$Q go tool cover -html .GOPATH/cover/all.merged
|
go tool cover -html .GOPATH/cover/all.merged
|
||||||
else
|
else
|
||||||
@echo "Coverage Report In CI..."
|
@echo "Coverage Report In CI..."
|
||||||
$Q go tool cover -html .GOPATH/cover/all.merged -o .GOPATH/cover/all.html
|
go tool cover -html .GOPATH/cover/all.merged -o .GOPATH/cover/all.html
|
||||||
endif
|
endif
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "=====> Total test coverage: <====="
|
@echo "=====> Total test coverage: <====="
|
||||||
@echo ""
|
@echo ""
|
||||||
$Q go tool cover -func .GOPATH/cover/all.merged
|
go tool cover -func .GOPATH/cover/all.merged
|
||||||
|
|
||||||
format: goimports
|
format: goimports
|
||||||
@echo "Formatting..."
|
@echo "Formatting..."
|
||||||
$Q find . -iname \*.go | grep -v \
|
find . -iname \*.go | grep -v \
|
||||||
-e "^$$" $(addprefix -e ,$(IGNORED_PACKAGES)) | xargs $(gobin_tool) -run $(goimports) -w
|
-e "^$$" $(addprefix -e ,$(IGNORED_PACKAGES)) | xargs $(gobin_tool) -run $(goimports) -w
|
||||||
|
|
||||||
##### =====> Internals <===== #####
|
##### =====> Internals <===== #####
|
||||||
@@ -166,17 +166,15 @@ gox: $(gobin_tool)
|
|||||||
# We make gox globally available, for people to use by hand
|
# We make gox globally available, for people to use by hand
|
||||||
$(gobin_tool) $(gox)
|
$(gobin_tool) $(gox)
|
||||||
|
|
||||||
Q := $(if $V,,@)
|
|
||||||
|
|
||||||
$(gobin_tool):
|
$(gobin_tool):
|
||||||
GO111MODULE=off go get -u github.com/myitcv/gobin
|
GO111MODULE=off go get -u github.com/myitcv/gobin
|
||||||
|
|
||||||
authors:
|
authors:
|
||||||
$Q git log --all --format='%aN <%cE>' | sort -u | sed -n '/github/!p' > GITAUTHORS
|
git log --all --format='%aN <%cE>' | sort -u | sed -n '/github/!p' > GITAUTHORS
|
||||||
$Q cat AUTHORS GITAUTHORS | sort -u > NEWAUTHORS
|
cat AUTHORS GITAUTHORS | sort -u > NEWAUTHORS
|
||||||
$Q mv NEWAUTHORS AUTHORS
|
mv NEWAUTHORS AUTHORS
|
||||||
$Q rm -f NEWAUTHORS
|
rm -f NEWAUTHORS
|
||||||
$Q rm -f GITAUTHORS
|
rm -f GITAUTHORS
|
||||||
|
|
||||||
checksums_2.3.1.txt:
|
checksums_2.3.1.txt:
|
||||||
curl -o checksums_2.3.1.txt -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/checksums.txt
|
curl -o checksums_2.3.1.txt -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/checksums.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user