【发布时间】:2019-09-01 16:11:19
【问题描述】:
假设我有一个 Jenkinsfile。在该 Jenkinsfile 中,是以下 sh 步骤:
sh "myScript.sh"
在 myScript.sh 中,声明了以下变量:
MY_VARIABLE="This is my variable"
如何从我的 Jenkinsfile 访问在 myScript.sh 中声明的 MY_VARIABLE?
【问题讨论】:
-
您无法访问在 Jenkinsfile 的 shell 脚本中声明的变量。其他方式是可能的,建议使用。
标签: bash variables groovy jenkins-pipeline sh