deliverybot / helm

GitHub action for deploying Helm charts.
https://deliverybot.dev
MIT License
132 stars 221 forks source link

Run 'helm repo update' #11

Closed ChrisBit closed 4 years ago

ChrisBit commented 5 years ago

From my Github Action log:

Run deliverybot/helm@v1
  with:
    release: xx
    namespace: default
    chart: bitnami/wordpress
    token: xx
    value-files: ["./deploy/values-production.yaml"]
  env:
    KUBECONFIG_FILE: xx
/usr/bin/docker run --name xx --label xx --workdir /github/workspace --rm -e KUBECONFIG_FILE -e INPUT_RELEASE -e INPUT_NAMESPACE -e INPUT_CHART -e INPUT_TOKEN -e INPUT_VALUE-FILES -e INPUT_VALUES -e INPUT_DRY-RUN -e INPUT_SECRETS -e INPUT_VERSION -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/xx.no/xx.no":"/github/workspace" xx:xx
helm upgrade xx bitnami/wordpress --install --wait --atomic --namespace=default --values=./values.yml --set=app.name=xx --values=./deploy/values-production.yaml
Error: failed to download "bitnami/wordpress" (hint: running `helm repo update` may help)
##[error]Error: The process 'helm' failed with exit code 1
##[error]The process 'helm' failed with exit code 1
##[error]Docker run failed with exit code 1

'helm repo update' should be run before executing the helm deploy command.

ChrisBit commented 5 years ago

I might be missing something here. I might have to helm repo add bitnami https://charts.bitnami.com/bitnami helm install bitnami/wordpress

But it doesn't look like there is support for running custom commands before deploy.

colinjfw commented 5 years ago

@ChrisBit ya definitely the helm repo add is the part that's probably missing here. Do you think this fits best as an argument? For example:

  with:
    release: xx
    repository: 'https://charts.bitnami.com'
ChrisBit commented 5 years ago

Hi @colinjfw !

Do you think maybe there will be support for running custom commands before deploy? Or is the plan to implement helm commands one by one, helm plugin install for example? If the last case, that argument looks like a good way to solve it.

colinjfw commented 5 years ago

Ya I don't really know what the best way to do it is with actions. I think the best way is to just provide a repository argument. I can probably work on a pull request today if I have time.

On Thu, Oct 10, 2019 at 4:48 AM Kristoffer Eide notifications@github.com wrote:

Hi @colinjfw https://github.com/colinjfw !

Do you think maybe there will be support for running custom commands before deploy? Or is the plan to implement helm commands one by one, helm plugin install for example? If the last case, that argument looks like a good way to solve it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deliverybot/helm/issues/11?email_source=notifications&email_token=ACR764MSAUPRQPAIPHMOINDQN4JATA5CNFSM4I6OKAMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEA36K5Q#issuecomment-540534134, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACR764PJYEQDEYDV2YC6Q33QN4JATANCNFSM4I6OKAMA .

--

Colin Walker colinwalker270@gmail.com | colinjfw.com | 778.709.1959

italolelis commented 5 years ago

@colinjfw maybe accepting a list of repositories 🤔 ? There would definitely be some cases where we would need more than one custom repository.

colinjfw commented 5 years ago

Ya that's a good suggestion.

On Mon, Oct 14, 2019 at 2:28 AM Ítalo Vietro notifications@github.com wrote:

@colinjfw https://github.com/colinjfw maybe accepting a list of repositories 🤔 ? There would definitely be some cases where we would need more than one custom repository.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deliverybot/helm/issues/11?email_source=notifications&email_token=ACR764N4BAGMHM7JQ4VOK3LQOQ3T5A5CNFSM4I6OKAMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBD4X2Q#issuecomment-541576170, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACR764ORRX7AX5272KL2HZDQOQ3T5ANCNFSM4I6OKAMA .

--

Colin Walker colinwalker270@gmail.com | colinjfw.com | 778.709.1959

colinjfw commented 5 years ago

@ChrisBit I just went to work on this and I realized something. If you specify the full url of the chart I believe that helm should use the for installation. So one of the wordpress charts should have the url like this:

https://charts.bitnami.com/bitnami/wordpress-7.5.3.tgz

If you specify that in the chart option I believe this will work for you. I actually like this better than the helm repo add command because I find it to be a bit more explicit.

Curious what you think.

ChrisBit commented 5 years ago

Hi! Yeah, this was interesting. Looks like the .tgz contains the actual files of the dependencies as well. I think will work. I'll test it as soon as I have time.

ChrisBit commented 5 years ago

Hi again. This did not work with the current helm binary, but I just tested it with helm3 and it works!

colinjfw commented 5 years ago

Oh that's surprising actually. If you can use helm3 that's great but I think it'll take folks a while to get off of helm version 2.

On Sat, Nov 2, 2019 at 9:23 AM Kristoffer Eide notifications@github.com wrote:

Hi again. This did not work with the current helm binary, but I just tested it with helm3 and it works!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deliverybot/helm/issues/11?email_source=notifications&email_token=ACR764MOJZILZDSRVKDQJYDQRWSQBA5CNFSM4I6OKAMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC47RPA#issuecomment-549058748, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACR764PGLOMJOLCKCL3LP3LQRWSQBANCNFSM4I6OKAMA .

--

Colin Walker colinwalker270@gmail.com | colinjfw.com | 778.709.1959

anasinnyk commented 5 years ago

It will be awesome to add helm dependency support.

colinjfw commented 5 years ago

Thanks @anasinnyk - I've been trying to get a better testing setup so I can test changes with this action against a real K8s cluster. Hopefully once I get that in I can do this.

colinjfw commented 5 years ago

It looks like helm v2 can install a chart from a url (see https://github.com/helm/helm/issues/1158#issuecomment-245752116).

Are there any specific errors that anyone is seeing using something like:

  chart: 'https://charts.bitnami.com/bitnami/wordpress-7.5.3.tgz'

I still think that's the best solution here.

dreamgonfly commented 4 years ago

Specifying URL is just a workaround, not the best solution at all, IMHO. Hope there will be better solution in the future.

raj-shekhar1 commented 4 years ago

@ChrisBit I just went to work on this and I realized something. If you specify the full url of the chart I believe that helm should use the for installation. So one of the wordpress charts should have the url like this:

https://charts.bitnami.com/bitnami/wordpress-7.5.3.tgz

If you specify that in the chart option I believe this will work for you. I actually like this better than the helm repo add command because I find it to be a bit more explicit.

Curious what you think.

This is not working for me but.

raj-shekhar1 commented 4 years ago

@colinjfw still same issue with helmv2 the git hub action is not able to download the chart. the error below - Error: failed to download "xxxx" (hint: running helm repo update may help)

[error]Error: The process 'helm' failed with exit code 1

[error]The process 'helm' failed with exit code 1

[error]Docker run failed with exit code 1