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
|
PYTHON ?= /usr/bin/python3
|
||||||
DESTDIR ?= /
|
DESTDIR ?= /
|
||||||
DOCKER ?= docker
|
DOCKER ?= podman
|
||||||
BACKEND ?= lorax-composer
|
BACKEND ?= lorax-composer
|
||||||
|
|
||||||
PKGNAME = lorax
|
PKGNAME = lorax
|
||||||
@ -101,17 +101,27 @@ local:
|
|||||||
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
|
@rm -rf /var/tmp/$(PKGNAME)-$(VERSION)
|
||||||
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
|
@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:
|
test-in-copy:
|
||||||
rsync -aP --exclude=.git /lorax-ro/ /lorax/
|
rsync -aP --exclude=.git /lorax-ro/ /lorax/
|
||||||
make -C /lorax/ ci
|
make -C /lorax/ ci
|
||||||
cp /lorax/.coverage /test-results/
|
cp /lorax/.coverage /test-results/
|
||||||
|
|
||||||
test-in-docker:
|
test-in-docker:
|
||||||
sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test .
|
$(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
|
@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:
|
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
|
ci: check test
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
# You can set these variables from the command line.
|
# You can set these variables from the command line.
|
||||||
SPHINXOPTS =
|
SPHINXOPTS =
|
||||||
SPHINXBUILD = sphinx-build-3
|
SPHINXBUILD ?= sphinx-build
|
||||||
SPHINXAPIDOC = sphinx-apidoc-3
|
SPHINXAPIDOC ?= sphinx-apidoc
|
||||||
PAPER =
|
PAPER =
|
||||||
BUILDDIR = .
|
BUILDDIR = .
|
||||||
SOURCEDIR = ../src/pylorax
|
SOURCEDIR = ../src/pylorax
|
||||||
|
Loading…
Reference in New Issue
Block a user