如何在詹金斯(Jenkins)中与判断性一起使用?

发布于 2025-02-01 10:04:53 字数 513 浏览 4 评论 0 原文

我正在尝试在我的 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'?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微凉 2025-02-08 10:04:53

与变量的结合由 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文