Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do I have to nest my charts inside of the charts/ subdirectory? #87

Open
jon-whit opened this issue Jul 10, 2021 · 8 comments
Open

Comments

@jon-whit
Copy link

Lets say I have a Git repository structured like this:

github.com/myorg/helm-charts
    chart1/
        templates/
        Chart.yaml
    chart2/
        templates/
        Chart.yaml
    README.md

If I pass the chart_dir in my GitHub Workflow file as the current checked out working directory (e.g. .), it doesn't work. If I re-organize my repository structure so that it maps to:

github.com/myorg/helm-charts
    charts/
        chart1/
            templates/
            Chart.yaml
        chart2/
            templates/
            Chart.yaml
    README.md

it works just fine.

Having a top-level repository helm-charts and requiring a nested charts directory stutters and is completely unnecessary. Why was this design decision chosen and would you be willing to change it?

jacksgt added a commit to martialblog/helm-charts that referenced this issue Jul 26, 2021
By default, chart-releaser-action looks for Helm charts in "charts/",
we have ours in the top-level directory. Need to explicitly pass this
option.

helm/chart-releaser-action#87
jacksgt added a commit to martialblog/helm-charts that referenced this issue Jul 26, 2021
By default, chart-releaser-action looks for Helm charts in "charts/",
we have ours in the top-level directory. Need to explicitly pass this
option.

helm/chart-releaser-action#87
@torstenwalter
Copy link

Looks like the option is called charts_dir https://github.com/helm/chart-releaser-action/blob/c25b74a/action.yml#L25. So you've been missing the s at the end.

      - name: Run chart-releaser
        uses: helm/chart-releaser-action@v1.2.1
        env:
          CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
        with:
          charts_dir: '.'

@jon-whit So I think this can be closed.

@ayoubfaouzi
Copy link

ayoubfaouzi commented Nov 24, 2021

That does not work to me either.

My chart files are in the root for my github project, using charts_dir: '.'

Run helm/chart-releaser-action@v1.2.1
Run owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
Looking up latest tag...
Discovering changed charts since '86d0b43dd19c8663bae29b68c03790c0a64a524c'...
WARNING: .github/workflows/Chart.yaml is missing, assuming that '.github/workflows' is not a Helm chart. Skipping.
Nothing to do. No chart changes detected.

using ../.. did not work either.

Cheers.

@torstenwalter
Copy link

Was you chart changed since commit 86d0b43dd19c8663bae29b68c03790c0a64a524c?

If you want to debug it I suggest to have a look at:
https://github.com/helm/chart-releaser-action/blob/main/cr.sh#L57-L59
https://github.com/helm/chart-releaser-action/blob/main/cr.sh#L222-L232

@ayoubfaouzi
Copy link

ayoubfaouzi commented Nov 25, 2021

Hi @torstenwalter

Yes my chart has changed since that commit, you can have a look here: https://github.com/saferwall/charts.

It seems like it always require the Chart.yaml to be located in a directory inside the charts_dir.

Thanks.

@torstenwalter
Copy link

https://github.com/saferwall/charts/blob/main/Chart.yaml#L2

Your chart is named saferwall so I think it expects it to be in a directory with that name. I thought you meant an additional directory named charts containing it.

@MurzNN
Copy link

MurzNN commented Feb 8, 2022

@torstenwalter If we have a single chart and want to create a Helm repo with this single chart, why do we need to create an additional subdirectory for it? Let's store it in root, without complicating the directory structure!

Managing each chart in separate Git repository is much more convenient than one large monorepo with a plain mix of commits and issues from different charts.

@torstenwalter
Copy link

@MurzNN fyi I am just a user of chart releaser, not a maintainer

@maximemoreillon
Copy link

maximemoreillon commented Feb 11, 2023

I would also prefer to have one repo per chart (as opposed to to all my charts in a a single repo) so the structure required by chart-releaser-action is not ideal for me.

Is it really more common to have all of one's charts in a monorepo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants