How do I use Jenkins Pipeline properties step?

会有一股神秘感。 提交于 2019-11-28 07:09:14
Christopher Orr

Using properties with explicit method syntax will work, i.e.:
properties( [ ... ] ) rather than properties [ ... ]

Alternatively, it will work without if you specify the parameter name, e.g.:

properties properties: [ ... ]

For example defining three properties is as easy as :

properties([
  parameters([
    string(name: 'submodule', defaultValue: ''),
    string(name: 'submodule_branch', defaultValue: ''),
    string(name: 'commit_sha', defaultValue: ''),
  ])
])

/* Accessible then with : params.submodule, params.submodule_branch...  */
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!