0
私はこのようなglobal functionています。このように呼ばれてJenkins Pipelineグローバル関数にマップを渡すにはどうすればいいですか?
def myStep(Closure body) {
def config = [:]
body.resolveStrategy = Closure.DELEGATE_FIRST
body.delegate = config
body()
echo config.name // works
echo config.configure // is null
}
:
myStep {
name = 'linux-build'
configure = [os: 'linux', dir: 'build']
echo "myStep"
}
通常の変数(name
)に取り組んでいるが、渡されたマップ(configure
は)しません。多分それはdef config = [:]
のためでしょうか?どのようにして関数内のマップにアクセスできますか?