I'm using Gradle as the build tool and I need to run helm commands like helm repo add
inside a Gradle task. I have tried as below.
exec {
workingDir = file("<Helm.exe location>")
CommandLine "helm.exe repo add"
}
But this fails with
Error: unknown command "repo add" for "helm"
Run 'helm --help' for usage.
Any help is much appreciated.
CodePudding user response:
Gradle exec is not doing any processing to the arguments. If you supply "repo add"
as argument, helm will receive one argument: "repo add"
. This would be the same as calling helm "repo add"
in the terminal. What you want to do is, supply two arguments: "repo", "add"
.
For more details see my answer here: gradle exec command line: difference between separated and connected args