chart-releaser
chart-releaser copied to clipboard
Add option to host the chart package files in the GitHub Pages branch
When using this tool on a private repo, helm is unable to download the chart package files. When you give Helm your username and password it uses it to authenticate to the repository (the index file). The index file then tells Helm where to get the tarball. If the tarball is hosted in some other location (Github Releases in this case) then it would require a second authentication (which Helm does not support). The solution is to host the files in the same place as your index file and make the links relative paths so there is no need for the second authentication. This PR adds a flag (--packages-with-index) to the upload and index commands to accomplish this. It would resolve #115
@stecky thanks for this PR, can you please sign the DCO and add some tests for this change? thanks!
ok @cpanato I signed the DCO and added some tests
I added a patch to the PR to use the token passed in to authenticate to the repo when checking for an existing index.yaml
Is it planned to be merged? It would be great to start using it.
Is it merging anytime soon?
@davidkarlsen I am also waiting on this functionality. Looks like a review is required to complete the merge.
@cpanato any chance of merging it?
Just hit this issue also, would love to see this merged
will add this to my backlog to perform some manual tests and check.
meantime @davidkarlsen @unguiculus @scottrigby any thoughts?
Just to bare in mind I found an issue with this approach while testing on the branched repository. The problem is with the pushToPagesBranch method in releaser.go. When that method is called to publish the chart to the gh-page branch and there is more that one chart (like when you have multiple subcharts) the push will fail committing the second chart. The cause for this is that the commits are being pushed directly from the current branch (main) to gh-pages branch. I worked around this issue by separating the subcharts in multiple repos but I guess it is not ideal. I think the solution would be to add to that method a logic to move to the gh-pages branch before making the commits and that way avoiding the conflict but haven't been able to put time to it. Hope this helps a little.
I find this overly complex. I am able to use this application (through the action) as follows:
- name: Run chart-releaser
uses: ./.github/actions/helm/chart-releaser-action
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NAME_TEMPLATE: "helm-chart-{{ .Version }}"
with:
charts_dir: charts
# see https://github.com/helm/chart-releaser/issues/115
# needed for private GitHub repos
charts_repo_url: https://raw.githubusercontent.com/owner/repo/gh-pages/
When using this tool on a private repo, helm is unable to download the chart package files. When you give Helm your username and password it uses it to authenticate to the repository (the index file). The index file then tells Helm where to get the tarball. If the tarball is hosted in some other location (Github Releases in this case) then it would require a second authentication (which Helm does not support). The solution is to host the files in the same place as your index file and make the links relative paths so there is no need for the second authentication. This PR adds a flag (
--packages-with-index) to the upload and index commands to accomplish this. It would resolve #115
When its done, Please add an example on how to use it . Thanks :)
When merge it ? we really need it.
Also hitting this as a blocker in our private repository. Anything I can help with to get this merged?
I am also waiting for this PR as I'm unable to use this tool currently.
for the time being use stecky/yet-another-chart-releaser-action@v1 - works perfect for me - THX @stecky
- name: Run chart-releaser
uses: stecky/yet-another-chart-releaser-action@v1
with:
packages_with_index: true
env:
YACR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Great thank you! And https://github.com/stecky/yet-another-chart-releaser already has documentation
The solution from stecky works great (thank you stecky), but this is clearly an in-demand feature that should be supported by the official Helm implementation.
Taking a core dependency on a fork of an official release branch in someone's personal github is at best a risky solution for anyone, and at worst a disaster for anyone who relies on this and the personal account decides to delete their repo/fork.
So I will ask again: is there anything I can do to facilitate and help get this PR merged so we can all use the official Helm chart releaser?
The solution from stecky gives me the same error I get with the original chart-releaser.

Can someone help me, I am really stuck with this. Please help!!!
This is the repo setup -

With stecky the .tgz files are getting created
The solution from stecky gives me the same error I get with the original chart-releaser.
Can someone help me, I am really stuck with this. Please help!!!
This is the repo setup -
With stecky the .tgz files are getting created
literally the same!! neither seem to tackle this problem... how is this outstanding for so long?
can we add some documentation to explain how to use that?
thanks for this PR
The blocker here is that we need documentation? @cpanato can you take another look? I see docs in the CLI
When that method is called to publish the chart to the gh-page branch and there is more that one chart (like when you have multiple subcharts) the push will fail committing the second chart. The cause for this is that the commits are being pushed directly from the current branch (main) to gh-pages branch.
I am testing this and I just faced this issue. If you have multiple charts to release this fails because of git push.
EDIT: I tested this code adding all my charts one-by-one and the index contains only the latest chart.
At the very least, the main documentation should point out that helm chart releaser only works with public repos. Very frustrating rabbit hole...
ping
Hey, any chance to see this PR finally get merged @cpanato ? Maybe some other people could do the review instead of @davidkarlsen and @unguiculus if they don't find the time. Would be great that this feature is supported by the official helm team so we can use it for organization's private repos.
Thanks in advance and let me know if I can help in any way, I would love to get this working and not have to use a clunky workaround.
Need a rebase to fix the conflicts and we will need to perform some tests, if you can help with the tests @jgiretimhaus will be great
Hey that's great to hear @cpanato ! Thanks !
I could do some test with some private repos for sure. Any ETA on the rebase ? I have some time this week to work on it.
Hey that's great to hear @cpanato ! Thanks !
I could do some test with some private repos for sure. Any ETA on the rebase ? I have some time this week to work on it.
i can rebase if the author does not do that, I will wait till next week, then I will perform the rebase
Love to hear that ! I was able to test the behavior of @stecky's chart releaser and it had the expected outcome. Helm was finally able to access the tarball once hosted on our entreprise private repo. Really great job @stecky ! I'm ready to test whenever the PR gets rebased next week !
Looks like there are conflicts to merge.