chore: doc: get current software version dynamically

This commit is contained in:
Stéphane Lesimple 2020-11-03 16:05:43 +00:00
parent 401e93941a
commit b8d9ed2ccb
No known key found for this signature in database
GPG key ID: 4B4A3289E9D35658
3 changed files with 7 additions and 3 deletions

View file

@ -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/"

View file

@ -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 ---------------------------------------------------

View file

@ -52,7 +52,7 @@ Get the tarball of the latest release, which can be found `here <https://github.
.. code-block:: shell
test -d /opt/bastion || mkdir -p /opt/bastion
tar -C /opt/bastion v3.00.00.tar.gz
tar -C /opt/bastion v__VERSION__.tar.gz
The code supports being hosted somewhere else on the filesystem hierarchy, but this is discouraged as you might need to adjust a lot of configuration files (notably sudoers.d, cron.d, init.d) that needs an absolute path.
You should end up with directories such as ``bin``, ``lib``, etc. directly under ``/opt/bastion``.