-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
44 lines (34 loc) · 1.04 KB
/
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
VERSION=$(shell git describe --tags --dirty)
REPO ?= planetlabs
REPO_PATH ?= datalake
IMAGE="$(REPO)/$(REPO_PATH):$(VERSION)"
.PHONY: docker # build the docker container
docker: version
docker build --build-arg VERSION=$(VERSION) -t $(IMAGE) .
.PHONY: devshell # Open a developer shell in the docker env
devshell: docker
docker run --rm -it -v $$PWD:/opt --entrypoint /bin/bash $(IMAGE)
test-client: docker
docker run --rm --entrypoint tox $(IMAGE) -c /opt/client/tox.ini
test-ingester: docker
docker run --rm --entrypoint py.test $(IMAGE) ingester
test-api: docker
docker run --rm --entrypoint py.test $(IMAGE) api
.PHONY: test # Run the tests
test:
echo VERSION=$(VERSION)
$(MAKE) test-client
$(MAKE) test-ingester
$(MAKE) test-api
.PHONY: push
push:
docker push $(IMAGE)
clean:
rm -rf version.txt
.PHONY: version
version:
@test -f version.txt \
|| echo $(VERSION) | tee version.txt
.PHONY: help # Generate list of targets with descriptions
help:
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/ \1: \2/' | expand -t20