From b8d9ed2ccbc13fd81e3f844b86fa6afb50b5e305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 3 Nov 2020 16:05:43 +0000 Subject: [PATCH] chore: doc: get current software version dynamically --- doc/sphinx/Makefile | 4 ++++ doc/sphinx/conf.py | 4 ++-- doc/sphinx/installation/basic.rst | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/sphinx/Makefile b/doc/sphinx/Makefile index 99143c5..586411c 100644 --- a/doc/sphinx/Makefile +++ b/doc/sphinx/Makefile @@ -7,9 +7,13 @@ SPHINXBUILD = sphinx-build SOURCEDIR = . BUILDDIR = _build +VERSION_FILES = conf.py installation/basic.rst +VERSION := $(shell perl -e 'require "../../lib/perl/OVH/Bastion.pm"; print $$OVH::Bastion::VERSION') + all: plugins default default: Makefile + @sed -i -e "s/__VERSION__/$(VERSION)/g" $(VERSION_FILES) @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @rsync -a --delete _build/html/ ../../docs/ @echo "HTML documentation copied to ../../docs/" diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index c4901b1..b339a3a 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -24,9 +24,9 @@ copyright = '2020, OVHcloud' author = 'The Bastion Authors' # The short X.Y version -version = '3.00.00' +version = '__VERSION__' # The full version, including alpha/beta/rc tags -release = '3.00.00' +release = '__VERSION__' # -- General configuration --------------------------------------------------- diff --git a/doc/sphinx/installation/basic.rst b/doc/sphinx/installation/basic.rst index c261ebe..a7c58c0 100644 --- a/doc/sphinx/installation/basic.rst +++ b/doc/sphinx/installation/basic.rst @@ -52,7 +52,7 @@ Get the tarball of the latest release, which can be found `here