【发布时间】:2013-12-24 07:03:24
【问题描述】:
我有代码可以在没有启用凭据的情况下在 Jenkins 上创建/更新作业。
const string FORMAT = "http://{0}:{1}/createItem?name={2}";
var path =
string.Format(
FORMAT,
this.config.JenkinsServer,
this.config.JenkinsPort,
buildName);
this.http.UploadString(
path,
definition,
new Header(HttpRequestHeader.ContentType, "text/xml"));
现在,我想通过启用凭据并在创建新作业时指定用户名/密码来向前迈出一步。我找到了an article about Authenticating scripted clients on Jenkins,但没有 C# 中的代码示例,也不知道该怎么做。
如何在启用凭据的情况下在 Jenkins 上创建/更新作业?
[更新] 在this link 中的 url 上指定用户名和密码也不起作用。
【问题讨论】: