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
This commit is contained in:
parent
d8ea37f267
commit
8930cad4fc
9
Dockerfile.docs
Normal file
9
Dockerfile.docs
Normal file
@ -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
|
18
Makefile
18
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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user