forked from nathanleclaire/tarzan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 975 Bytes
/
Makefile
File metadata and controls
29 lines (22 loc) · 975 Bytes
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
DOCKER_IMAGE := nathanleclaire/tarzan
DOCKER_CONTAINER := tarzan-build
DOCKER_SRC_PATH := /go/src/github.com/nathanleclaire/tarzan
default: dockerbuild
dockerbuild: clean
docker build -t $(DOCKER_IMAGE) .
docker run --name $(DOCKER_CONTAINER) --entrypoint true $(DOCKER_IMAGE)
docker cp $(DOCKER_CONTAINER):$(DOCKER_SRC_PATH)/tarzan .
docker rm $(DOCKER_CONTAINER)
cleanbinary:
rm -f tarzan
cleancontainers:
docker rm $(DOCKER_CONTAINER) $(DOCKER_CONTAINER)-deps $(DOCKER_CONTAINER)-test 2>/dev/null || true
deps: cleancontainers
docker run --name $(DOCKER_CONTAINER)-deps \
-v $(shell pwd):$(DOCKER_SRC_PATH) \
$(DOCKER_IMAGE) sh -c "go get github.com/tools/godep && pwd && go get ./... && godep save"
docker rm $(DOCKER_CONTAINER)-deps 2>/dev/null || true
test: dockerbuild
docker run --name $(DOCKER_CONTAINER)-test --entrypoint sh $(DOCKER_IMAGE) -c 'go test'
docker rm $(DOCKER_CONTAINER)-test 2>/dev/null || true
clean: cleanbinary cleancontainers