def props = readJSON file: 'dir/input.json'
assert props['attr1'] == 'One'
assert props.attr1 == 'One'
def props = readJSON text: '{ "key": "value" }'
assert props['key'] == 'value'
assert props.key == 'value'
def props = readJSON text: '[ "a", "b"]'
assert props[0] == 'a'
assert props[1] == 'b'
def props = readJSON text: '{ "key": null, "a": "b" }', returnPojo: true
assert props['key'] == null
props.each { key, value ->
echo "Walked through key $key and value $value"
}
依赖插件
https://plugins.jenkins.io/pipeline-utility-steps/#releases
https://updates.jenkins.io/download/plugins/snakeyaml-api/1.30.2-76.vc104f7ce9870/snakeyaml-api.hpi
版权属于:区块链中文技术社区 / 转载原创者
本文链接:https://bcskill.com/index.php/archives/1334.html
相关技术文章仅限于相关区块链底层技术研究,禁止用于非法用途,后果自负!本站严格遵守一切相关法律政策!