1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00
Files
archived-doc-en/Makefile
Christian Weiske a4bcdd05f1 Change permissions for cloned repositories
The current user and group ID are passed passed to the docker build command
and the ownership of the cloned directories are changed to them.
This gets rid of git's "dubious ownership" error.

Without this changes I got an error:
> $ make
> docker run --rm -v :/var/www/en -w /var/www -u 1000:1000 php/doc-en
> configure.php on PHP 8.2.29, libxml 2.9.14
>
> fatal: detected dubious ownership in repository at '/var/www/doc-base'
> To add an exception for this directory, call:
>
> 	git config --global --add safe.directory /var/www/doc-base
> doc-base/temp clean up FAILED.
> make: *** [Makefile:22: xhtml] Fehler 1

Resolves: https://github.com/php/doc-en/pull/4645
2026-03-05 15:24:21 +01:00

35 lines
799 B
Makefile

.PHONY: *
SHELL = /bin/sh
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)
#
# If doc-base or phd exist as siblings to the current directory, add those as
# volumes to our Docker runs.
#
PATHS := -v ${PWD}:/var/www/en
ifneq ($(wildcard ../doc-base/LICENSE),)
PATHS += -v ${PWD}/../doc-base:/var/www/doc-base
endif
ifneq ($(wildcard ../phd/LICENSE),)
PATHS += -v ${PWD}/../phd:/var/www/phd
endif
xhtml: .docker/built
docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} php/doc-en
php: .docker/built
docker run --rm ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} \
-e FORMAT=php php/doc-en
build: .docker/built
.docker/built:
docker build\
--build-arg UID=${CURRENT_UID} --build-arg GID=${CURRENT_GID}\
.docker -t php/doc-en
touch .docker/built