I am trying to do a helm package deployment using Jenkins pipeline. I am able to package the charts and deploy it. But in order to make it a dynamic deployment, I want to get the package name once formed & pass it down for further processing.
I have tried below options for groovy, but the variable "packageNm" is not getting any value.
def packageNm = sh(script: "cd ${appName}; printf '%s\n' ${appName}*.tgz", returnStatus: true)
def packageNm = sh(script: "helm package hello-helm -d hello-helm", returnStatus: true)
Any way to get this file name? I even tried to search the file in workspace but the variable name is still empty
You should use returnStdout
instead of returnStatus
for getting the standard output into the variable.