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

52 lines
1.5 KiB
Makefile
Raw Normal View History

REPO?=quay.io/coreos/prometheus-operator
TAG?=$(shell git rev-parse --short HEAD)
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
PROMU := $(GOPATH)/bin/promu
PREFIX ?= $(shell pwd)
2017-02-14 17:54:37 -08:00
CLUSTER_IP?=$(shell kubectl config view --minify | grep server: | cut -f 3 -d ":" | tr -d "//")
pkgs = $(shell go list ./... | grep -v /vendor/ | grep -v /test/)
all: check-license format build test
build: promu
@$(PROMU) build --prefix $(PREFIX)
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:
2017-02-14 17:54:37 -08:00
go test -timeout 20m -v ./test/e2e/ $(TEST_RUN_ARGS) --kubeconfig "$(HOME)/.kube/config" --operator-image=$(REPO):$(TAG) --namespace=$(NAMESPACE) --cluster-ip=$(CLUSTER_IP)
e2e-status:
kubectl get prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,replicationcontrollers --all-namespaces
e2e:
$(MAKE) container
$(MAKE) e2e-test
clean-e2e:
kubectl -n $(NAMESPACE) delete prometheus,alertmanager,servicemonitor,statefulsets,deploy,svc,endpoints,pods,cm,replicationcontrollers --all
kubectl delete namespace $(NAMESPACE)
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
.PHONY: all build crossbuild test format check-license container e2e-test e2e-status e2e clean-e2e