From e4759fd5cd7679bb31ea500f4f37b4a944bed120 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 11 Apr 2021 10:58:30 +0200 Subject: [PATCH] contrib/jenkins.sh: Build and publish PDF manual Change-Id: I3f01e93dd5a25d26feb3d067a171244a20f0f8e5 --- contrib/jenkins.sh | 12 +++++++++++- docs/Makefile | 16 ++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index dc2692c3..2d9653ad 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,4 +1,10 @@ #!/bin/sh +# jenkins build helper script for pysim. This is how we build on jenkins.osmocom.org +# +# environment variables: +# * WITH_MANUALS: build manual PDFs if set to "1" +# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1") +# set -e @@ -24,8 +30,12 @@ python -m unittest discover -v -s tests/ pip install sphinx pip install sphinxcontrib-napoleon pip3 install -e 'git+https://github.com/osmocom/sphinx-argparse@master#egg=sphinx-argparse' -(cd docs && make html) +(cd docs && make html latexpdf) # run the test with physical cards cd pysim-testdata ../tests/pysim-test.sh + +if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then + make -C "$base/docs" publish +fi diff --git a/docs/Makefile b/docs/Makefile index d4bb2cbb..4e20876d 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,13 +8,25 @@ SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build +# for osmo-gsm-manuals +OSMO_GSM_MANUALS_DIR=$(shell pkg-config osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null) +OSMO_REPOSITORY = "pysim" +UPLOAD_FILES = $(BUILDDIR)/latex/osmopysim-usermanual.pdf +CLEAN_FILES = $(UPLOAD_FILES) + # Put it first so that "make" without argument is like "make help". +.PHONY: help help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile +$(BUILDDIR)/latex/pysim.pdf: latexpdf + @/bin/true + +# put this before the catch-all below +include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile +%: @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)