Skip to content

Commit

Permalink
Add git tag support
Browse files Browse the repository at this point in the history
  • Loading branch information
TilBlechschmidt committed Jul 27, 2020
1 parent bc678c3 commit 8108e1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mkdocs_helm/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ def build_chart(self, helm_bin, site_dir, chart_dir, chart):
output_chart_dir = (pathlib.PurePath(site_dir) /
pathlib.PurePath(chart_dir)).as_posix()
command = [helm_bin, 'package', '-d', output_chart_dir, chart]

# Pass the git ref in GitHub Actions
git_ref = os.getenv('GITHUB_REF')
if git_ref is not None and git_ref.startswith('refs/tags/') and os.getenv('HELM_USE_GIT_TAG') is not None:
version = git_ref[10:]
command += ['--version', version, '--app-version', version]
print("Overwriting helm chart version and app-version with git tag '" + version + "'")

subprocess.check_output(command)

def build_chart_index(self, helm_bin, site_dir, helm_repo_url):
Expand Down

0 comments on commit 8108e1b

Please sign in to comment.