我必须定义一个选择组合框,其中在Jenkins环境变量(Manage Jenkins → Configure System → Global properties → Environment variables
)中定义了可用值的列表。我该如何实现?
我尝试使用build
和env
对象,但是它们是未定义的。
我发现了怎么做:
import hudson.slaves.EnvironmentVariablesNodeProperty
import jenkins.model.Jenkins
Jenkins.get().globalNodeProperties.get(EnvironmentVariablesNodeProperty).envVars['VARIABLE_NAME']
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句