2016-09-02 27 views
0

我将Jenkins与我的VisualSVN Server连接起来,并且可以通过单击Jenkins中的构建按钮来创建构建。但是现在我想通过使用post-commit来触发构建。我使用TortoiseSVN + Jenkins + VisualSVN服务器为Jenkins设置VirtualSVN中的post-commit

我尝试了两种方法,但都没有为我工作。

首先,我读这篇文章page,而像笔者使用这段代码:

C:\curl\curl http://admin:[email protected]:8080/jenkins/job/Cannon%20Attack%20-%20Dom%20Millar/build?token=MyAuth 

我也试了一下,没有任何标记,没有任何登录信息

C:\curl\curl http://admin:[email protected]:8080/jenkins/job/Cannon%20Attack%20-%20Dom%20Millar/build?delay=0sec 

第二左右逢源我试过的代码是从这个page

C:\Repositories\NunitTests\JenkinsNotifier.rb Cannon%20Attack%20-%20Dom%20Millar/ 

而JenkinsNotifier.rb包含此代码:

# Push a notice to the hudson server to initiate a build. 

# Ensure the required libs are present 
require "net/http" 
require "uri" 

# Get the project name 
hudsonProject = ARGV[0] 

# Create the uri and issue the request 
uri = URI.parse("http://localhost:8080/jenkins/job/" + Cannon%20Attack%20-%20Dom%20Millar + "/build?delay=0sec") 
Net::HTTP::get_print uri 

错误: 1.Way: enter image description here

2.Way: 我没有得到一个错误,但也积累开始犯规。

+1

错误表示找不到路径 – Perazim

回答

1

我修好了。这是一个语法问题。 Curl doenst接受“%20”。我删除了所有这些,并删除了jenkins中项目名称中的空格。

"C:\curl\curl" http://localhost:8080/job/CannonAttack-DomMillar/build?token=MyAuth 
PAUSE