-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathMakefile
50 lines (39 loc) · 947 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
44
45
46
47
48
49
IMAGE_NAME=dcos-metrics-dev
.PHONY: all
all: clean build test
.PHONY: build
build: docker
$(call buildIt,collector)
$(call buildIt,statsd-emitter)
$(call buildIt,collector-emitter)
.PHONY: plugins
plugins: docker clean
$(call buildIt,plugins)
.PHONY: test
test: docker clean build
$(call testIt,collector unit)
.PHONY: clean
clean:
# Clean from within the docker container to avoid issues with file permissions:
$(call buildIt,clean)
.PHONY: docker
docker:
docker build -t $(IMAGE_NAME) .
.PHONY: rawbuild
rawbuild:
bash -c "./scripts/build.sh collector"
bash -c "./scripts/build.sh statsd-emitter"
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