Goodsmileduck / helm-push-action

This action package a helm chart and publish it to your chartmuseum.
10 stars 23 forks source link

Is '${CHART_FOLDER}-*' a typo ? #25

Closed KrustyHack closed 1 year ago

KrustyHack commented 2 years ago

Ay,

Thanks for this Ghitub Action, but I have a question about the last line : https://github.com/Goodsmileduck/helm-push-action/blob/39d65bb6f8cdc3b7b4655a5598ec38da767e788a/entrypoint.sh#L52

Is ${CHART_FOLDER}-* a typo ?

I got this error on my workflow :

  build-helm:
    name: Build Helm
    runs-on: ubuntu-latest

    needs: [xxx]

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - uses: goodsmileduck/helm-push-action@v3
        env:
          SOURCE_DIR: '.'
          CHART_FOLDER: 'my/path'
          FORCE: 'True'
          CHARTMUSEUM_URL: '${{ secrets.ORG_CHARTMUSEUM_URL }}'
          CHARTMUSEUM_USER: '${{ secrets.ORG_CHARTMUSEUM_USERNAME }}'
          CHARTMUSEUM_PASSWORD: ${{ secrets.ORG_CHARTMUSEUM_PASSWORD }}
+ helm cm-push 'my/path-*' *** -u *** -p '***' -f
Error: stat my/path-*: no such file or directory
KrustyHack commented 2 years ago

Ay,

I found the problem. My chart is on a folder named XXX but the chart name is YYY :

+ helm package .
Successfully packaged chart and saved it to: /github/workspace/apps/myapp/infra/helm/myapp-0.1.0.tgz
+ helm cm-push 'apps/myapp/infra/helm-*' *** -u *** -p '***' -f
Goodsmileduck commented 2 years ago

well, it's not typo, ideally it should:

  1. build helm chart package with name chart-0.1.1.tgz (where 0.1.1 is version)
  2. push that package to chart museum, since that action does not parse version from chart, I just used regex for file name.
Goodsmileduck commented 2 years ago

you can check test pipeline logs maybe to see how it works https://github.com/Goodsmileduck/helm-push-action/actions/runs/3126127522/jobs/5071266648 step: Test helm v3 push

Goodsmileduck commented 2 years ago

and example usages for action https://github.com/Goodsmileduck/helm-push-action/blob/master/.github/workflows/helm3.yml#L37-L45

KrustyHack commented 2 years ago

Ay @Goodsmileduck ,

Yes but my problem is that the folder where my Helm chart is has not the same name as my chart !

gasparpn commented 1 year ago

@KrustyHack , I have a similar problem. Did you do something to fix your problem?

Goodsmileduck commented 1 year ago

@gasparpn hi, renaming folder is not an option?

gasparpn commented 1 year ago

@Goodsmileduck , Thanks for replying. So, that could be an option. The name value in Chart.yaml has to be the same as my chart folder name?

Goodsmileduck commented 1 year ago

@Goodsmileduck , Thanks for replying. So, that could be an option. The name value in Chart.yaml has to be the same as my chart folder name?

Yes. Ideally

gasparpn commented 1 year ago

I changed the SOURCE_DIR to the directory that the chart directory is under.

@KrustyHack , in your case it would be

SOURCE_DIR: "myapp/infra"
CHART_FOLDER: "helm"

@Goodsmileduck , also using FORCE=False adds a -f parameter that makes the push command to fail.