From 031eb8da34df898d2f825d280e85989bd1357762 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Tue, 20 Sep 2016 12:12:20 +0200 Subject: [PATCH] Add Makefile (#25) * Remove canonical import path This either causes issues for the CI or people having the repo checked out into the correct k8s.io/kube-state-metrics directory . * Add Makefile --- Makefile | 26 ++++++++++++++++++++++++++ main.go | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..9a413fba --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +all: build + +FLAGS = +ENVVAR = GOOS=linux GOARCH=amd64 CGO_ENABLED=0 +REGISTRY = gcr.io/google_containers +TAG = v0.2.0 + +deps: + go get github.com/tools/godep + +build: clean deps + $(ENVVAR) godep go build -o kube-state-metrics + +test-unit: clean deps build + $(ENVVAR) godep go test --race . $(FLAGS) + +container: build + docker build -t ${REGISTRY}/kube-state-metrics:$(TAG) . + +push: container + gcloud docker push ${REGISTRY}/kube-state-metrics:$(TAG) + +clean: + rm -f kube-state-metrics + +.PHONY: all deps build test-unit container push clean diff --git a/main.go b/main.go index f167ac0a..783cb092 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main // import "github.com/kubernetes/kube-state-metrics" +package main import ( "fmt"