Skip to content

Commit

Permalink
*: remove containerized build process as golang is already locked in …
Browse files Browse the repository at this point in the history
…go.mod

Signed-off-by: paulfantom <[email protected]>
  • Loading branch information
paulfantom committed Apr 29, 2020
1 parent 1b0aff1 commit 2c39f26
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,10 @@ doccheck: generate
@cd docs; for doc in *.md; do if [ "$$doc" != "README.md" ] && ! grep -q "$$doc" *.md; then echo "ERROR: No link to documentation file $${doc} detected"; exit 1; fi; done
@echo OK

build-local: clean
GOOS=$(shell uname -s | tr A-Z a-z) GOARCH=$(ARCH) CGO_ENABLED=0 go build -ldflags "-s -w -X ${PKG}/version.Release=${TAG} -X ${PKG}/version.Commit=${Commit} -X ${PKG}/version.BuildDate=${BuildDate}" -o kube-state-metrics

build: clean kube-state-metrics

kube-state-metrics:
${DOCKER_CLI} run --rm -v "${PWD}:/go/src/k8s.io/kube-state-metrics" -w /go/src/k8s.io/kube-state-metrics golang:${GO_VERSION} $(MAKE) ARCH=$(ARCH) build-local
GOOS=$(shell uname -s | tr A-Z a-z) GOARCH=$(ARCH) CGO_ENABLED=0 go build -ldflags "-s -w -X ${PKG}/version.Release=${TAG} -X ${PKG}/version.Commit=${Commit} -X ${PKG}/version.BuildDate=${BuildDate}" -o kube-state-metrics

test-unit: clean build
GOOS=$(shell uname -s | tr A-Z a-z) GOARCH=$(ARCH) $(TESTENVVAR) go test --race $(FLAGS) $(PKGS)
Expand Down Expand Up @@ -146,7 +143,7 @@ clean:
e2e:
./tests/e2e.sh

generate: build-local
generate: build
@echo ">> generating docs"
@./scripts/generate-help-text.sh
@$(GOPATH)/bin/embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print`
Expand Down Expand Up @@ -179,4 +176,4 @@ install-tools:
@echo Installing tools from tools.go
@cat tools/tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -tI % go install %

.PHONY: all build build all-push all-container all-manifest test-unit test-benchmark-compare container push quay-push clean e2e validate-modules shellcheck licensecheck lint generate embedmd
.PHONY: all build all-push all-container all-manifest test-unit test-benchmark-compare container push quay-push clean e2e validate-modules shellcheck licensecheck lint generate embedmd

0 comments on commit 2c39f26

Please sign in to comment.