forked from mesosphere-backup/dcos-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (34 loc) · 729 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
IMAGE_NAME=dcos-metrics-dev
.PHONY: all
all: clean build test
.PHONY: build
build: docker
$(call buildIt,collector)
$(call buildIt,statsd-emitter)
.PHONY: plugins
plugins: docker clean
$(call buildIt,plugins)
.PHONY: test
test: docker clean build
$(call testIt,collector unit)
.PHONY: clean
clean:
rm -rf ./build
rm -rf ./schema/metrics_schema
.PHONY: docker
docker:
docker build -t $(IMAGE_NAME) .
define testIt
$(call containerIt,bash -c "./scripts/test.sh $1")
endef
define buildIt
$(call containerIt,bash -c "./scripts/build.sh $1")
endef
define containerIt
docker run \
--rm \
-v $(shell pwd):/go/src/github.com/dcos/dcos-metrics \
-w /go/src/github.com/dcos/dcos-metrics \
$(IMAGE_NAME) \
$1
endef