summaryrefslogtreecommitdiff
path: root/kvmd/Makefile
blob: 0f23dfb32ef8bdb54c30281bb7f3c668066b2cfe (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
TESTENV_IMAGE ?= kvmd-testenv
TESTENV_VIDEO ?= /dev/video0
TESTENV_LOOP ?= /dev/loop7
TESTENV_CMD ?= /bin/bash -c " \
		nginx -c /testenv/nginx.conf \
		&& 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


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
	#make tox
	make clean
	make push
	make bump
	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