如何让 Hudson CI 通过 SSH 检查 CVS 项目?
我有我的 Hudson CI 服务器设置。我有一个 CVS 存储库,我只能通过 ssh 签出内容。但我认为没有办法说服 Hudson 通过 ssh 签出。在提供连接字符串时,我尝试了各种选项。
有人这样做过吗?我想它已经完成了。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我还记得 CVS,我想你必须将 CVS_RSH 环境变量设置为 ssh。我怀疑您需要设置此值,以便您的 Tomcat 进程继承此值。
您可以检查 Hudson 系统信息,以准确了解 JVM 所看到的环境变量(并传递到构建)。
If I still remember CVS, I thought you have to set CVS_RSH environment variable to ssh. I suspect you need to set this so that your Tomcat process gets this value inherited.
You can check Hudson system information to see exactly what environment variables the JVM is seeing (and passes along to the build.)
我写了一篇文章来解决这个问题,你可以在这里找到它:
http://www.openscope。 net/2011/01/03/configure-ssh-authorized-keys-for-cvs-access/
本质上,您希望为构建用户设置无密码 ssh 密钥。这将允许进行身份验证,而无需找到某种方式来键入密码。
<编辑>即本质上是标准的 .ssh 密钥客户端和服务器安装/交换。
http://en.wikipedia.org/wiki/Secure_Shell#Key_management
用于 jenkins 用户帐户:
在cvs 服务器上的
添加到jenkins 用户上的 帐户:
* 请注意,每当远程服务器更改密钥/IP 时,您都需要手动访问 cvs 并再次接受密钥 *
还有另一种方法可以做到这一点,但您必须手动从构建机器登录到 cvs 服务器并保持 ssh 会话打开,以便 hudson/jenkins 可以搭载连接。不过,这对我来说似乎毫无意义,因为你希望你的 CI 服务器尽可能不受干扰。
I wrote up an article that tackles this you can find it here:
http://www.openscope.net/2011/01/03/configure-ssh-authorized-keys-for-cvs-access/
Essentially you want to set up passphraseless ssh keys for your build user. This will allow authentication to occur without the need to work out some kind of way to key in your password.
<edit> i.e. Essentially the standard .ssh key client & server install/exchange.
http://en.wikipedia.org/wiki/Secure_Shell#Key_management
for the jenkins user account:
on cvs server:
back on jenkins user account:
* note any time remote server changes key/ip you will need to manually access cvs and accept key again *
</edit>
There's another way to do it but you have to manually log from the build machine to your cvs server and keep the ssh session open so hudson/jenkins can piggyback the connection. Seemed kinda pointless to me though since you want your CI server to be as hands off as possible.