如何将key=value
对注入到使用读取属性读取的属性?
...
props = readProperties file: "$parametersFile"
fileParams = props.collect { string(name: it.key, value: it.value) }
build job: "anotherjobName", parameters: fileParams // good, passes parameters read from $parametersFile
fileParams.inject(["EXTRA_PARAM=xparam_value"]) // Is there a way to inject the additional parameter to fileParams, something like this?
build job: "yetAnotherjobName", parameters: fileParams
我可以按如下方式进行操作:
xParam = [ $class: 'StringParameterValue','name': 'EXTRA_PARAM', 'value': "xparam_value" ]
build job: "yetAnotherjobName", parameters: fileParams + xParam