summaryrefslogtreecommitdiff
path: root/kvmd/Makefile
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-08 06:28:12 +0000
committerDevaev Maxim <[email protected]>2018-07-08 06:28:12 +0000
commit41ce7ff2862816a7d97792851e00a6daf400905e (patch)
tree32ba8222b98f8a37310d20c581685db8e102c8fb /kvmd/Makefile
parentb1d72e86637b233d26e7b68724251d98030d6052 (diff)
test environment for docker
Diffstat (limited to 'kvmd/Makefile')
-rw-r--r--kvmd/Makefile38
1 files changed, 36 insertions, 2 deletions
diff --git a/kvmd/Makefile b/kvmd/Makefile
index 5a9737ef..d9e6d8fb 100644
--- a/kvmd/Makefile
+++ b/kvmd/Makefile
@@ -1,8 +1,37 @@
+TESTENV_IMAGE ?= kvmd-testenv
+TESTENV_VIDEO ?= /dev/video0
+TESTENV_LOOP ?= /dev/loop7
+TESTENV_CMD ?= /bin/bash -c " \
+ ln -s $(TESTENV_VIDEO) /dev/kvmd-streamer \
+ && (losetup -d /dev/kvmd-msd || true) \
+ && losetup /dev/kvmd-msd /root/loop.img \
+ && python -m kvmd -c testenv/kvmd.yaml \
+ "
+
+
+# =====
all:
cat Makefile
-bencoder:
- python3 setup.py build_ext --inplace
+
+run:
+ docker build --rm --tag $(TESTENV_IMAGE) -f testenv/Dockerfile .
+ - docker run --rm \
+ --volume `pwd`/kvmd:/kvmd:ro \
+ --volume `pwd`/web:/web:ro \
+ --volume `pwd`/testenv:/testenv:ro \
+ --device $(TESTENV_LOOP):/dev/kvmd-msd \
+ --device $(TESTENV_VIDEO):$(TESTENV_VIDEO) \
+ --publish 8080:8080/tcp \
+ --publish 8081:8081/tcp \
+ --publish 8082:8082/tcp \
+ -it $(TESTENV_IMAGE) $(TESTENV_CMD)
+ - docker run --rm --device=$(TESTENV_LOOP):/dev/kvmd-msd -it $(TESTENV_IMAGE) losetup -d /dev/kvmd-msd
+
+
+shell:
+ make run TESTENV_CMD=/bin/bash
+
release:
make clean
@@ -13,19 +42,24 @@ release:
make push
make clean
+
tox:
tox
+
bump:
bumpversion minor
+
push:
git push
git push --tags
+
clean:
rm -rf build site dist pkg src *.egg-info kvmd-*.tar.gz
find -name __pycache__ | xargs rm -rf
+
clean-all: clean
rm -rf .tox .mypy_cache