1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 09:16:38 +00:00
prometheus-operator/Makefile

81 lines
2.7 KiB
Makefile
Raw Normal View History

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 '')
KUBECONFIG?=$(HOME)/.kube/config
2016-11-01 17:36:06 +01:00
PROMU := $(GOPATH)/bin/promu
PREFIX ?= $(shell pwd)
pkgs = $(shell go list ./... | grep -v /vendor/ | grep -v /test/)
all: check-license format build test
build: promu
@$(PROMU) build --prefix $(PREFIX)
2017-10-11 02:13:35 +02:00
short-build:
go install github.com/coreos/prometheus-operator/cmd/operator
crossbuild: promu
@$(PROMU) crossbuild
test:
@go test -short $(pkgs)
format:
go fmt $(pkgs)
check-license:
./scripts/check_license.sh
container:
2016-11-01 17:36:06 +01:00
docker build -t $(REPO):$(TAG) .
e2e-test:
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-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)
e2e-status:
kubectl get prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,secrets,replicationcontrollers --all-namespaces
e2e:
$(MAKE) container
$(MAKE) e2e-test
clean-e2e:
kubectl -n $(NAMESPACE) delete prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,secrets,replicationcontrollers --all
kubectl delete namespace $(NAMESPACE)
promu:
@go get -u github.com/prometheus/promu
embedmd:
@go get github.com/campoy/embedmd
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
$(GOPATH)/bin/embedmd -w `find Documentation -name "*.md"`
$(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
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-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