2017-01-04 14:57:06 +01:00
|
|
|
REPO?=quay.io/coreos/prometheus-operator
|
|
|
|
TAG?=$(shell git rev-parse --short HEAD)
|
2017-01-17 15:38:48 +01:00
|
|
|
NAMESPACE?=prometheus-operator-e2e-tests-$(shell LC_CTYPE=C tr -dc a-z0-9 < /dev/urandom | head -c 13 ; echo '')
|
2016-11-01 17:36:06 +01:00
|
|
|
|
2017-01-30 18:12:27 +01:00
|
|
|
PROMU := $(GOPATH)/bin/promu
|
|
|
|
PREFIX ?= $(shell pwd)
|
|
|
|
|
2017-01-13 12:14:00 +01:00
|
|
|
CLUSTER_IP?=$(shell minikube ip)
|
|
|
|
|
2017-01-19 11:02:12 +01:00
|
|
|
pkgs = $(shell go list ./... | grep -v /vendor/ | grep -v /test/)
|
|
|
|
|
|
|
|
all: check-license format build test
|
|
|
|
|
2017-01-30 18:12:27 +01:00
|
|
|
build: promu
|
|
|
|
@$(PROMU) build --prefix $(PREFIX)
|
2016-10-18 16:33:15 +02:00
|
|
|
|
2017-01-19 11:02:12 +01:00
|
|
|
test:
|
|
|
|
@go test -short $(pkgs)
|
|
|
|
|
|
|
|
format:
|
|
|
|
go fmt $(pkgs)
|
|
|
|
|
|
|
|
check-license:
|
|
|
|
./scripts/check_license.sh
|
|
|
|
|
2016-10-18 16:33:15 +02:00
|
|
|
container:
|
2016-11-02 17:40:17 +01:00
|
|
|
GOOS=linux $(MAKE) build
|
2016-11-01 17:36:06 +01:00
|
|
|
docker build -t $(REPO):$(TAG) .
|
|
|
|
|
2017-01-05 16:31:47 +01:00
|
|
|
e2e-test:
|
2017-01-13 12:14:00 +01:00
|
|
|
go test -timeout 20m -v ./test/e2e/ $(TEST_RUN_ARGS) --kubeconfig "$(HOME)/.kube/config" --operator-image=quay.io/coreos/prometheus-operator:$(TAG) --namespace=$(NAMESPACE) --cluster-ip=$(CLUSTER_IP)
|
|
|
|
|
|
|
|
e2e-status:
|
2017-01-18 19:07:22 +01:00
|
|
|
kubectl get prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm --all-namespaces
|
2017-01-05 16:31:47 +01:00
|
|
|
|
|
|
|
e2e:
|
|
|
|
$(MAKE) container
|
|
|
|
$(MAKE) e2e-test
|
2016-11-24 12:38:09 +01:00
|
|
|
|
|
|
|
clean-e2e:
|
2017-01-18 19:07:22 +01:00
|
|
|
kubectl -n $(NAMESPACE) delete prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm --all
|
2017-01-13 12:14:00 +01:00
|
|
|
kubectl delete namespace $(NAMESPACE)
|
2016-11-24 12:38:09 +01:00
|
|
|
|
2017-01-30 18:12:27 +01:00
|
|
|
promu:
|
|
|
|
@GOOS=$(shell uname -s | tr A-Z a-z) \
|
|
|
|
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
|
|
|
|
go get -u github.com/prometheus/promu
|
|
|
|
|
2017-01-19 11:02:12 +01:00
|
|
|
.PHONY: all build test format check-license container e2e-test e2e-status e2e clean-e2e
|