From 3ea085d3512d022cc6539adb9c006b2a8e9641e7 Mon Sep 17 00:00:00 2001 From: jo Date: Tue, 16 Aug 2022 13:22:09 +0200 Subject: [PATCH] chore: add python docker-* targets This allow testing in a similar context to the github CI. --- .gitignore | 1 + playout/Makefile | 1 + tools/python.mk | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/.gitignore b/.gitignore index ca462e5e8..fbc984c9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ ## Custom .gitignore ################################################################################ +.docker/ .DS_Store .idea/ .vagrant/ diff --git a/playout/Makefile b/playout/Makefile index b68236111..ae2a620ec 100644 --- a/playout/Makefile +++ b/playout/Makefile @@ -2,6 +2,7 @@ all: lint include ../tools/python.mk +APP := playout PIP_INSTALL := \ --editable ../api-client \ --editable ../shared \ diff --git a/tools/python.mk b/tools/python.mk index e26e2b3c0..c9d858f22 100644 --- a/tools/python.mk +++ b/tools/python.mk @@ -74,3 +74,19 @@ install: $(VENV) .PHONY: .clean .clean: rm -Rf $(VENV) + +DISTRO ?= bullseye +DOCKER_RUN = docker run -it --rm \ + --user $$(id -u):$$(id -g) \ + --env HOME=/src/.docker/$(DISTRO) \ + --volume $$(pwd)/..:/src \ + --workdir /src/$(APP) \ + ghcr.io/libretime/libretime-dev:$(DISTRO) + +docker-dev: + $(MAKE) clean + $(DOCKER_RUN) bash + +docker-test: + $(MAKE) clean + $(DOCKER_RUN) make test