如果要从
shstep 返回输出并将其捕获到变量中,则必须更改:
def response = sh 'curl https://some-host/some-service/getApi?apikey=someKey'
至:
def response = sh(script: 'curl https://some-host/some-service/getApi?apikey=someKey', returnStdout: true)
参考: https : //jenkins.io/doc/pipeline/steps/workflow-durable-
task-step/#sh-shell-script
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)