我最近从自由式转换为使用詹金斯的管道构建。
因此,我将参数定义移动到Jenkins文件本身中,如下所示:
parameters {
string name: 'PHID', defaultValue: '', description: '', trim: false
string name: 'DIFF_ID', defaultValue: '', description: '', trim: false
string name: 'ABORT_ON_REVISION_ID', defaultValue: '', description: '', trim: false
string name: 'customComment', defaultValue: '.phabricator-comment', description: '', trim: false
credentials name: 'XX', credentialType: 'org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl', defaultValue: 'XXX', description: '', required: true
credentials name: 'YY', credentialType: 'org.jenkinsci.plugins.plaincredentials.impl.StringCredentialsImpl', defaultValue: 'YYY', description: '', required: true
}
注意:customComment,XX,YY的参数值是静态的和预定义的。因此,我不需要向他们提供网络通话。
但是如何从VCS / SCM触发构建?常规URI似乎不适用于管道定义的参数:
https://jenkins.fooo.bar/job/STAGING/buildWithParameters?token=XXX&DIFF_ID=YYYY&PHID=ZZZZ&ABORT_ON_REVISION_ID=AAAA
此方法端点buildWithParameters
是否仍然有效? -还是我想念其他东西吗?