mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
* Use environment variable for format to build * Use Makefile instead of docker-compose.yml This allows us to build different formats more easily, and use phd and doc-base from parallel checkouts, which is much easier for issues that span the repositories.
33 lines
716 B
Makefile
33 lines
716 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 .:/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 ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} php/doc-en
|
|
|
|
php: .docker/built
|
|
docker run ${PATHS} -w /var/www -u ${CURRENT_UID}:${CURRENT_GID} \
|
|
-e FORMAT=php php/doc-en
|
|
|
|
build: .docker/built
|
|
|
|
.docker/built:
|
|
docker build .docker -t php/doc-en
|
|
touch .docker/built
|