docs: Extract current version from git and use it in the install instructions.

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-12-17 09:46:26 +01:00
parent 7f6e244f61
commit c2c97997cd
2 changed files with 24 additions and 9 deletions
+14
View File
@@ -13,6 +13,8 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import re
# -- Project information -----------------------------------------------------
@@ -20,6 +22,18 @@ project = 'Kapow!'
copyright = '2019, BBVA Innovation Labs'
author = 'BBVA Innovation Labs'
# The full version, including alpha/beta/rc tags.
try:
release = re.sub('^v', '', os.popen('git describe').read().strip())
except:
release = 'unknown'
try:
# The short X.Y.Z-rcN version.
version = re.search('^(\d+\.\d+\.\d+(:?-rc\d+)?)', release).group(0)
except:
version = release
# -- General configuration ---------------------------------------------------
@@ -22,9 +22,10 @@ Linux
Install the downloaded binary using the following command as a privileged user.
.. code-block:: console
.. parsed-literal::
# install kapow\_\ |version|\ _linux_amd64 /usr/local/bin/kapow
# install kapow_?.?.?-linux_amd64 /usr/local/bin/kapow
Windows
@@ -47,14 +48,14 @@ run:
Note that *Kapow!* leverages `Go modules`_, so you can target specific releases:
.. code-block:: console
.. parsed-literal::
$ GO111MODULE=on go get -v github.com/BBVA/kapow@v0.3.0-rc4
go: finding github.com v0.3.0-rc4
go: finding github.com/BBVA v0.3.0-rc4
go: finding github.com/BBVA/kapow v0.3.0-rc4
go: downloading github.com/BBVA/kapow v0.3.0-rc4
go: extracting github.com/BBVA/kapow v0.3.0-rc4
$ GO111MODULE=on go get -v github.com/BBVA/kapow@v\ |version|
go: finding github.com v\ |version|
go: finding github.com/BBVA v\ |version|
go: finding github.com/BBVA/kapow v\ |version|
go: downloading github.com/BBVA/kapow v\ |version|
go: extracting github.com/BBVA/kapow v\ |version|
github.com/google/shlex
github.com/google/uuid
github.com/spf13/pflag