Makefile: Build docs in a container

Enables to build docs in a container even when go-md2man is not installed
locally.

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
This commit is contained in:
ERAMOTO Masaya 2019-01-15 18:47:25 +09:00
parent 17bea86e89
commit ec810c91fe

View File

@ -1,4 +1,4 @@
.PHONY: all binary build-container docs build-local clean install install-binary install-completions shell test-integration vendor
.PHONY: all binary build-container docs docs-in-container build-local clean install install-binary install-completions shell test-integration vendor
export GO15VENDOREXPERIMENT=1
@ -65,7 +65,7 @@ endif
# Note: Uses the -N -l go compiler options to disable compiler optimizations
# and inlining. Using these build options allows you to subsequently
# use source debugging tools like delve.
all: binary docs
all: binary docs-in-container
# Build a container image (skopeobuild) that has everything we need to build.
# Then do the build and the output (skopeo) should appear in current dir
@ -94,6 +94,11 @@ docs/%.1: docs/%.1.md
docs: $(MANPAGES_MD:%.md=%)
docs-in-container:
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage .
${CONTAINER_RUNTIME} run --rm --security-opt label=disable -v $$(pwd):/src/github.com/containers/skopeo \
skopeobuildimage make docs $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)'
clean:
rm -f skopeo docs/*.1