mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Makefile: add precheck target
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
46cdf0b674
commit
a9ff66427b
4
Makefile
4
Makefile
|
@ -25,6 +25,10 @@ STATICCHECK_IGNORE = \
|
|||
|
||||
DOCKER_IMAGE_NAME ?= prometheus
|
||||
|
||||
# Go modules needs the bzr binary because of the dependency on launchpad.net/gocheck.
|
||||
$(eval $(call PRECHECK_COMMAND_template,bzr))
|
||||
PRECHECK_OPTIONS_bzr = version
|
||||
|
||||
.PHONY: assets
|
||||
assets:
|
||||
@echo ">> writing assets"
|
||||
|
|
|
@ -68,7 +68,7 @@ DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
|
|||
DOCKER_REPO ?= prom
|
||||
|
||||
.PHONY: all
|
||||
all: style staticcheck unused build test
|
||||
all: precheck style staticcheck unused build test
|
||||
|
||||
# This rule is used to forward a target like "build" to "common-build". This
|
||||
# allows a new "build" target to be defined in a Makefile which includes this
|
||||
|
@ -195,3 +195,19 @@ ifdef GOVENDOR
|
|||
$(GOVENDOR):
|
||||
GOOS= GOARCH= $(GO) get -u github.com/kardianos/govendor
|
||||
endif
|
||||
|
||||
.PHONY: precheck
|
||||
precheck::
|
||||
|
||||
define PRECHECK_COMMAND_template =
|
||||
precheck:: $(1)_precheck
|
||||
|
||||
|
||||
PRECHECK_COMMAND_$(1) ?= $(1) $$(strip $$(PRECHECK_OPTIONS_$(1)))
|
||||
.PHONE: $(1)_precheck
|
||||
$(1)_precheck:
|
||||
@if ! $$(PRECHECK_COMMAND_$(1)) 1>/dev/null 2>&1; then \
|
||||
echo "Execution of '$$(PRECHECK_COMMAND_$(1))' command failed. Is $(1) installed?"; \
|
||||
exit 1; \
|
||||
fi
|
||||
endef
|
||||
|
|
Loading…
Reference in a new issue