哈德森svn凭证

时间:2010-12-27 18:57:19

标签: hudson

如何通过shell在Hudson中输入subversion凭据? 我试图在HUDSON_HOME中生成文件hudson.scm.SubversionSCM.xml并重新加载配置,但未应用更改。

3 个答案:

答案 0 :(得分:2)

从shell输入凭证的最简单方法是使用“svn”可执行文件。 Hudson识别它创建的~/.subversion/auth目录。

答案 1 :(得分:0)

在Windows下,全局凭据存储在%APPDATA%\Subversion\auth下。以下Groovy代码有助于生成这些凭据:

SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url))
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.defaultConfigurationDirectory,"AD\user","password",true)
repository.setAuthenticationManager(authManager)
repository.getDir("", -1, null ,(Collection)null) // or some random SVN operation

上面代码中使用的库(Gradle中的示例):

compile 'org.tmatesoft.svnkit:org.tmatesoft.svnkit:1.7.8'
compile 'net.java.dev.jna:jna:3.4.0' // so wincrypt is available

确保使用在Windows计算机上运行的Hudson用户运行代码。

答案 2 :(得分:0)

从哈德森开始吧。 安装所有必需的插件。 点击链接,EX:-localhost:8080 / hudson 单击添加作业/创建作业。 在选择SVN选项时,请提供SVN位置。 凭据链接出现在那里。单击该链接。 表单将打开,为SVN的该位置提供有效凭据。 观察屏幕上的Success消息,然后返回Create job,Complete with Job creation和Build the task。