Skip to content

Commit

Permalink
Merge pull request #2879 from manics/docs-fix-gitref
Browse files Browse the repository at this point in the history
docs: fix git sha lookup for dev builds
  • Loading branch information
consideRatio authored Sep 18, 2022
2 parents 9a7d03d + 283f150 commit b30710e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ def setup(app):
def _get_git_ref_from_chartpress_based_version(version):
"""
Get a git ref from a chartpress set version of format like
1.2.3-beta.1.n123.h1234567, 1.2.3-n123.h1234567, or 1.2.3.
- 2.0.1-0.dev.git.5810.hf475e7a4 return git hash
- 2.0.0-beta.1 return tag
- 2.0.0 return tag
"""
tag_hash_split = re.split(r"[\.|-]n\d\d\d\.h", version)
if len(tag_hash_split) == 2:
return tag_hash_split[1]
else:
return tag_hash_split[0]
m = re.match(r"\d+\.\d+\.\d+(-.+\.h([0-9a-f]+))$", version)
if m:
return m.group(2)
return version


# FIXME: Stop relying on chartpress to modify Chart.yaml (and values.yaml) by
Expand Down

0 comments on commit b30710e

Please sign in to comment.