2017-01-04 14:57:06 +01:00
|
|
|
REPO?=quay.io/coreos/prometheus-operator
|
|
|
|
TAG?=$(shell git rev-parse --short HEAD)
|
2017-05-04 11:14:31 +02:00
|
|
|
NAMESPACE?=po-e2e-$(shell LC_CTYPE=C tr -dc a-z0-9 < /dev/urandom | head -c 13 ; echo '')
|
2017-06-28 14:45:36 +02:00
|
|
|
KUBECONFIG?=$(HOME)/.kube/config
|
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-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-10-11 02:13:35 +02:00
|
|
|
short-build:
|
|
|
|
go install github.com/coreos/prometheus-operator/cmd/operator
|
|
|
|
|
2017-01-31 15:16:09 +01:00
|
|
|
crossbuild: promu
|
|
|
|
@$(PROMU) crossbuild
|
|
|
|
|
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-01 17:36:06 +01:00
|
|
|
docker build -t $(REPO):$(TAG) .
|
|
|
|
|
2017-01-05 16:31:47 +01:00
|
|
|
e2e-test:
|
2017-07-24 16:00:24 +05:30
|
|
|
go test -timeout 20m -v ./test/migration/ $(TEST_RUN_ARGS) --kubeconfig=$(KUBECONFIG) --operator-image=$(REPO):$(TAG) --namespace=$(NAMESPACE)
|
2017-07-14 16:06:30 +02:00
|
|
|
go test -timeout 20m -v ./test/e2e/ $(TEST_RUN_ARGS) --kubeconfig=$(KUBECONFIG) --operator-image=$(REPO):$(TAG) --namespace=$(NAMESPACE)
|
2017-01-13 12:14:00 +01:00
|
|
|
|
2017-10-16 15:11:53 +02:00
|
|
|
e2e-test-only:
|
|
|
|
go test -timeout 20m -v ./test/e2e/ $(TEST_RUN_ARGS) --kubeconfig=$(KUBECONFIG) --operator-image=$(REPO):$(TAG) --namespace=$(NAMESPACE)
|
|
|
|
|
2017-01-13 12:14:00 +01:00
|
|
|
e2e-status:
|
2017-03-09 10:04:28 +01:00
|
|
|
kubectl get prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,secrets,replicationcontrollers --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-03-09 10:04:28 +01:00
|
|
|
kubectl -n $(NAMESPACE) delete prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,secrets,replicationcontrollers --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:
|
2017-03-08 11:04:32 +01:00
|
|
|
@go get -u github.com/prometheus/promu
|
2017-01-30 18:12:27 +01:00
|
|
|
|
2017-03-02 13:54:28 +01:00
|
|
|
embedmd:
|
2017-03-08 11:04:32 +01:00
|
|
|
@go get github.com/campoy/embedmd
|
2017-03-02 13:54:28 +01:00
|
|
|
|
2017-08-01 10:11:33 +02:00
|
|
|
po-docgen:
|
|
|
|
@go install github.com/coreos/prometheus-operator/cmd/po-docgen
|
2017-03-06 16:24:59 +01:00
|
|
|
|
2017-08-01 10:11:33 +02:00
|
|
|
docs: embedmd po-docgen
|
2017-07-17 10:32:03 +02:00
|
|
|
$(GOPATH)/bin/embedmd -w `find Documentation -name "*.md"`
|
2017-08-22 12:54:38 +02:00
|
|
|
$(GOPATH)/bin/po-docgen api pkg/client/monitoring/v1/types.go > Documentation/api.md
|
2017-08-01 10:11:33 +02:00
|
|
|
$(GOPATH)/bin/po-docgen compatibility > Documentation/compatibility.md
|
2017-03-06 16:24:59 +01:00
|
|
|
|
2017-07-27 14:17:57 +02:00
|
|
|
generate: jsonnet-docker
|
|
|
|
docker run --rm -v `pwd`:/go/src/github.com/coreos/prometheus-operator po-jsonnet make jsonnet generate-bundle docs
|
|
|
|
|
|
|
|
generate-bundle:
|
|
|
|
hack/generate-bundle.sh
|
|
|
|
|
|
|
|
jsonnet:
|
|
|
|
jsonnet -J /ksonnet-lib hack/generate/prometheus-operator.jsonnet | json2yaml > example/non-rbac/prometheus-operator.yaml
|
|
|
|
jsonnet -J /ksonnet-lib hack/generate/prometheus-operator-rbac.jsonnet | json2yaml > example/rbac/prometheus-operator/prometheus-operator.yaml
|
|
|
|
jsonnet -J /ksonnet-lib hack/generate/prometheus-operator-rbac.jsonnet | json2yaml > contrib/kube-prometheus/manifests/prometheus-operator/prometheus-operator.yaml
|
|
|
|
|
|
|
|
jsonnet-docker:
|
2017-11-06 18:12:55 +01:00
|
|
|
docker build -f scripts/Dockerfile -t po-jsonnet .
|
2017-03-02 13:54:28 +01:00
|
|
|
|
2017-03-06 16:24:59 +01:00
|
|
|
.PHONY: all build crossbuild test format check-license container e2e-test e2e-status e2e clean-e2e embedmd apidocgen docs
|