English 中文(简体)
如何在安全时远程使用jenkins
原标题:how to use jenkins remotely when it s secure

I m using jenkins api xml to create a new job, see jobs, builds ... it works only when jenkins is not secure I m using this code to create new job

PostMethod postMethod = new PostMethod("localhost:8080/createItem?name="+projectName);
postMethod.setRequestHeader("Content-type","application/xml; charset=ISO-8859-1");
postMethod.setRequestBody(new FileInputStream(new File("/resources/config.xml")));
HttpClient client = new HttpClient();
returnCode = client.executeMethod(postMethod);
最佳回答

你们需要把用户和皮条带给你们。 例如

问题回答

这里是ruby的客户,帮助通过APICAP在jenkins创造就业。 虽然“Jenkins”只允许张贴“XML”,但该客户接受“Hash”的参数,并设立“XML”,将其职位交给“Jen”。 您可以通过提供有关Jenkins服务器信息及其证书,向客户提供初步信息。

gem install jenkins_api_client

require "rubygems"
require "jenkins_api_client"

# Initialize the client by passing in the server information
# and credentials to communicate with the server
client = JenkinsApi::Client.new(
  :server_ip => "127.0.0.1",
  :username => "awesomeuser",
  :password => "awesomepassword"
)

# The following block will create 10 jobs in Jenkins
# test_job_0, test_job_1, test_job_2, ...
10.times do |num|
  client.job.create_freestyle(:name => "test_job_#{num}")
end

# The jobs in Jenkins can be listed using
client.job.list_all




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签