From 8930cad4fcdd7e3268d152692798673dc4214ac6 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 29 Jun 2021 11:11:32 -0700 Subject: [PATCH] Makefile: Use user-mode podman and fix docs-in-docker target The docs target was broken, which made it difficult to easily update the documentation and notice missing documentation. podman is now widespread, and user-mode doesn't need root so switch to using that. Leave the Makefile target names in place so that CI isn't confused. Related: rhbz#1955355 --- Dockerfile.docs | 9 +++++++++ Makefile | 18 ++++++++++++++---- docs/Makefile | 4 ++-- 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 Dockerfile.docs diff --git a/Dockerfile.docs b/Dockerfile.docs new file mode 100644 index 00000000..cce48d81 --- /dev/null +++ b/Dockerfile.docs @@ -0,0 +1,9 @@ +FROM centos:8 +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +COPY ./test-packages . +RUN dnf -y install $(cat ./test-packages) && touch /.in-container +RUN pip3 install pocketlint Sphinx sphinx-rtd-theme sphinx-argparse +RUN useradd weldr +VOLUME /lorax-ro +VOLUME /test-results +WORKDIR /lorax-ro diff --git a/Makefile b/Makefile index d529f9b7..f86768f5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PYTHON ?= /usr/bin/python3 DESTDIR ?= / -DOCKER ?= docker +DOCKER ?= podman BACKEND ?= lorax-composer PKGNAME = lorax @@ -101,17 +101,27 @@ local: @rm -rf /var/tmp/$(PKGNAME)-$(VERSION) @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz" +local-srpm: local $(PKGNAME).spec + rpmbuild -bs \ + --define "_sourcedir $(CURDIR)" \ + --define "_srcrpmdir $(CURDIR)" \ + lorax.spec + test-in-copy: rsync -aP --exclude=.git /lorax-ro/ /lorax/ make -C /lorax/ ci cp /lorax/.coverage /test-results/ test-in-docker: - sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test . - sudo $(DOCKER) run --rm -it -v `pwd`/.test-results/:/test-results -v `pwd`:/lorax-ro:ro --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy + $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test . + @mkdir -p `pwd`/.test-results + $(DOCKER) run --rm -it -v `pwd`/.test-results/:/test-results -v `pwd`:/lorax-ro:ro --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy docs-in-docker: - sudo $(DOCKER) run -it --rm -v `pwd`/docs/html/:/lorax/docs/html/ --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make docs + $(DOCKER) build -t welder/lorax-docs:$(IMAGE_RELEASE) -f Dockerfile.docs . + $(DOCKER) run -it --rm -v `pwd`:/lorax-ro:ro -v `pwd`/docs/:/lorax-ro/docs/ \ + --security-opt label=disable \ + welder/lorax-docs:$(IMAGE_RELEASE) make docs ci: check test diff --git a/docs/Makefile b/docs/Makefile index 1bab5ce5..804b29ba 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,8 +3,8 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = sphinx-build-3 -SPHINXAPIDOC = sphinx-apidoc-3 +SPHINXBUILD ?= sphinx-build +SPHINXAPIDOC ?= sphinx-apidoc PAPER = BUILDDIR = . SOURCEDIR = ../src/pylorax