Makefile: Use sudo to fix ownership of docs

rootless podman leaves the files owned by the container UID, this
requires sudo to chown them back to the user.
This commit is contained in:
Brian C. Lane 2021-07-06 15:36:53 -07:00
parent 0b2ce51d96
commit de2c88883a
1 changed files with 5 additions and 3 deletions

View File

@ -79,7 +79,7 @@ docs:
# This is needed to reset the ownership of the new docs files after they are created in a container
set-docs-owner:
chown -R $(LOCAL_UID):$(LOCAL_GID) docs/
sudo chown -R $(LOCAL_UID):$(LOCAL_GID) docs/
archive:
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
@ -124,7 +124,8 @@ test-in-podman:
-v `pwd`:/lorax-ro:ro --security-opt label=disable \
--env RUN_TESTS="$(RUN_TESTS)" \
welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy
# rootless podman leaves them owned by the container UID
$(MAKE) set-docs-owner
docs-in-docker: docs-in-podman
@ -134,7 +135,8 @@ docs-in-podman:
-v `pwd`/docs/:/lorax-ro/docs/ \
--env LORAX_VERSION=$(DOCS_VERSION) \
--env LOCAL_UID=`id -u` --env LOCAL_GID=`id -g` \
--security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make docs set-docs-owner
--security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make docs
ci: check test