我正在尝试在我的 jenkinsfile
中检索Perforce的凭据。使用标准Jenkins凭据商店保存P4凭据。我需要凭据才能处于范围,以便我可以调用可以从实用程序中调用 p4
操作的实用程序。该实用程序期望设置 p4port
环境变量。
我知道 withCredentials
,但是,我不确定如何利用它来检索保存在凭据上的 p4port
属性。
我发现的最接近的凭证绑定是 usernamepassword()
,但是这似乎无法让我访问 p4port
属性。
我正在遇到的错误是:
Credentials 'my-credentials-id' is of type 'Perforce Password Credential'...
是否有旨在与'Perforce密码凭据'
一起使用的绑定?
I am attempting to retrieve the credentials for Perforce in my Jenkinsfile
. The p4 credentials are saved using the standard Jenkins credentials store. I need the credentials to be in scope so that I can call a utility that will invoke p4
operations from a utility. The utility expects the P4PORT
environment variable to be set.
I am aware of withCredentials
, however, I am not sure how to leverage this to retrieve the P4Port
property saved on the credential.
The closest credentials binding I've found is usernamePassword()
, however that doesn't seem to be able to give me access to the P4Port
property.
The error I am experiencing is:
Credentials 'my-credentials-id' is of type 'Perforce Password Credential'...
Is there a binding that is intended to be used with 'Perforce Password Credential'
?
发布评论
评论(1)
与变量的结合由 https://plugins.jenkins.io/credentials.io/credentials-binding/ < /a>
它仅支持特定类型的凭据,请参阅
因此,凭证插件必须具有凭证界面,允许访问其他信息,特别是您的p4port。然后P4插件可以实现它。
P4插件用Perforce密码凭据支持用户名/密码(StandardusernamePasswordcredentials)。
The binding to a variable is handled by https://plugins.jenkins.io/credentials-binding/
It only supports specific types of credentials, see
https://javadoc.jenkins.io/plugin/credentials/com/cloudbees/plugins/credentials/common/package-summary.html
So the credentials plugin would have to have a credential Interface that allows access to additional information, specifically your P4PORT. Then the p4 plugin could implement it.
The p4 plugin supports the username/password (StandardUsernamePasswordCredentials) with the perforce password credential.