diff options
| author | Martin Atkins <matkins@saymedia.com> | 2018-08-25 17:01:35 -0700 |
|---|---|---|
| committer | Martin Atkins <matkins@saymedia.com> | 2018-08-25 17:01:35 -0700 |
| commit | 33120477c74e94d1a530664f66a1dc394106854f (patch) | |
| tree | 1b75e0a37fcc1bced35b3f8789c7b02ebde222be /guide/conf.py | |
| parent | c6f6feed76e0101fed44c3b98c40170442de7996 (diff) | |
guide: When running in Read The Docs, get version from its environment
Git isn't available in the Read The Docs build, but we don't actually need
it there anyway because we are told the version number that Read The Docs
thinks it is building.
Diffstat (limited to 'guide/conf.py')
| -rw-r--r-- | guide/conf.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/guide/conf.py b/guide/conf.py index 168a469..8b3ecfa 100644 --- a/guide/conf.py +++ b/guide/conf.py @@ -1,4 +1,5 @@ import subprocess +import os import os.path # -- Project information ----------------------------------------------------- @@ -7,12 +8,15 @@ project = u'HCL' copyright = u'2018, HashiCorp' author = u'HashiCorp' -git_version = subprocess.check_output(['git', 'describe', '--always']).strip() +if 'READTHEDOCS_VERSION' in os.environ: + version_str = os.environ['READTHEDOCS_VERSION'] +else: + version_str = subprocess.check_output(['git', 'describe', '--always']).strip() # The short X.Y version -version = unicode(git_version) +version = unicode(version_str) # The full version, including alpha/beta/rc tags -release = unicode(git_version) +release = unicode(version_str) # -- General configuration --------------------------------------------------- |
