diff --git a/.gitignore b/.gitignore index e0f9973..5a94d88 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.pyc dist/ deb_dist/ +docker/src/ build/ env/ _trial_temp/ diff --git a/Makefile b/Makefile index 2b9c82f..31a7325 100644 --- a/Makefile +++ b/Makefile @@ -79,6 +79,7 @@ clean: deb_docker: /opt/qemu/bin @if ! [ -d /opt/qemu ]; then echo "Docker cross build requires patched QEMU!\nApply ./scripts/qemu/qemu.patch to qemu-7.2.0 and build it:\n ./configure --prefix=/opt/qemu --static --disable-system && make && sudo make install"; exit 1; fi if ! ls /proc/sys/fs/binfmt_misc | grep -q qemu ; then sudo ./scripts/qemu/qemu-binfmt-conf.sh --qemu-path /opt/qemu/bin --persistent yes; fi + cp -a Makefile docker/src/ TAG="wfb-ng:build-`date +%s`"; docker build -t $$TAG docker --build-arg SRC_IMAGE=$(DOCKER_SRC_IMAGE) && \ docker run -i --rm -v $(PWD):/build $$TAG bash -c "trap 'chown -R --reference=. .' EXIT; export VERSION=$(VERSION) COMMIT=$(COMMIT) SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) && cd /build && make clean && make test && make deb" docker ps -a -f 'status=exited' --format '{{ .ID }} {{ .Image }}' | grep wfb-ng:build | tail -n+11 | while read c i ; do docker rm $$c && docker rmi $$i; done diff --git a/docker/Dockerfile b/docker/Dockerfile index b47c837..2c8329e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -11,8 +11,8 @@ RUN apt-get update && \ python3-future python3-all python3-all-dev \ python3-serial dh-python python3-setuptools python3-msgpack + +COPY src/Makefile /tmp ENV ENV=/opt/env ENV PYTHON=python3 - -RUN virtualenv --python=$PYTHON $ENV -RUN $ENV/bin/pip install --upgrade pip setuptools git+https://github.com/svpcom/stdeb +RUN cd /tmp && make $ENV diff --git a/docker/src/.gitignore b/docker/src/.gitignore new file mode 100644 index 0000000..e69de29