-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
47 lines (40 loc) · 1.2 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
45
46
47
# Non released dlt-daemon version based on 2.18.10
LIBDLT_VERSION=v2.18.10
IMAGE=python-dlt/python-dlt-unittest
TAG?=latest
DK_CMD=docker run --rm -v $(shell pwd):/pydlt -w /pydlt
TEST_ARGS?="-e py3,lint"
.PHONY: all
all:
@echo "python-dlt testing commands, libdlt version: ${LIBDLT_VERSION}"
@echo " make unit-test -- Run unit tests with tox (Run 'make build-image' the first time)"
@echo " make build-image -- Build docker image for the usage of 'make unit-test'"
@echo " make clean -- Remove all temporary files"
.PHONY: unit-test
unit-test:
${DK_CMD} ${IMAGE}:${TAG} tox ${TEST_ARGS}
.PHONY: lint
lint:
${DK_CMD} ${IMAGE}:${TAG} tox -e lint
.PHONY: build-image
build-image:
docker build --build-arg LIBDLT_VERSION=${LIBDLT_VERSION} \
--tag ${IMAGE}:${TAG} .
docker build --build-arg LIBDLT_VERSION=${LIBDLT_VERSION} \
--tag ${IMAGE}:${LIBDLT_VERSION} .
.PHONY: bash
bash:
${DK_CMD} -it ${IMAGE}:${TAG}
.PHONY: clean
clean:
ifeq (,$(wildcard /.dockerenv))
${DK_CMD} ${IMAGE}:${TAG} make clean
else
find . -name "__pycache__" | xargs -n1 rm -rf
find . -name "*.pyc" | xargs -n1 rm -rf
rm -rf .coverage
rm -rf *.egg-info
rm -rf .eggs
rm -rf junit_reports
rm -rf .tox
endif