【发布时间】:2020-01-23 07:41:58
【问题描述】:
主要目的是我想将一些文件提交到SVN存储库并触发jenkins自动构建一些测试。我想使用的方法是post-commit hook。
我使用 TortoiseSVN,并创建了一个存储库进行测试。 我将 post-commit.tmpl 更改为位于 D:\Repository\hooks 文件夹中的 post-commit.bat。
下面是 post-commit.bat 中的内容:(Windows 10)
SET REPOS=%1
SET REV=%2
FOR /f "tokens=*" %%a IN (
'svnlook uuid %REPOS%'
) DO (
SET UUID=%%a
)
FOR /f "tokens=*" %%b IN (
'svnlook changed --revision %REV% %REPOS%'
) DO (
SET POST=%%b
)
D:/Wget/wget ^
--header="Content-Type:text/plain;charset=UTF-8" ^
--post-data="%POST%" ^
--output-document="-" ^
--timeout=2 ^
http://localhost:8080/jenkins/subversion/%UUID%/notifyCommit?rev=%REV%
错误信息是:
post-commit hook failed (exit code 8)with output:
--2019-09-23 13:50:53--
http://localhost:8080/"realUUID"/notifyCommit?rev=7
Resolving localhost(localhost)... ::1, 127.0.0.1
Connecting to localhost(localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-09-23 13:50:53 ERROR 404: Not Found
我所做的是: 1.将jenkins设置更改为“允许匿名读取访问” 2.取消CSRF保护
我不知道 SVN 与 Jenkins 通信的主要步骤是什么。
请帮忙,谢谢你的回答!
【问题讨论】:
标签: jenkins svn post-commit-hook