简体   繁体   English

如何让Hudson CI通过SSH签出CVS项目?

[英]How to get Hudson CI to check out CVS projects over SSH?

I have my Hudson CI server setup. 我有哈德森CI服务器设置。 I have a CVS repo that I can only checkout stuff via ssh. 我有一个CVS仓库,我只能通过ssh签出东西。 But I see no way to convince Hudson to check out via ssh. 但是我没有办法说服哈德森通过ssh签出。 I tried all sorts of options when supplying my connection string. 提供连接字符串时,我尝试了各种选择。

Has anyone done this? 有人这样做吗? I gotta think it has been done. 我想这已经完成了。

If I still remember CVS, I thought you have to set CVS_RSH environment variable to ssh. 如果我仍然记得CVS,我认为您必须将CVS_RSH环境变量设置为ssh。 I suspect you need to set this so that your Tomcat process gets this value inherited. 我怀疑您需要设置此项,以便您的Tomcat进程继承该值。

You can check Hudson system information to see exactly what environment variables the JVM is seeing (and passes along to the build.) 您可以检查Hudson系统信息,以准确了解JVM正在查看哪些环境变量(并传递给构建。)

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/ 我写了一篇文章来解决这个问题,您可以在这里找到: 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. 本质上,您想为构建用户设置无密码的ssh密钥。 This will allow authentication to occur without the need to work out some kind of way to key in your password. 这将允许进行身份验证,而无需找出某种方式来键入密码。

<edit> ie Essentially the standard .ssh key client & server install/exchange. <edit>即本质上是标准.ssh密钥客户端和服务器的安装/交换。 http://en.wikipedia.org/wiki/Secure_Shell#Key_management http://en.wikipedia.org/wiki/Secure_Shell#Key_management

for the jenkins user account: 对于jenkins用户帐户:

  • install user key (public & private part) in ~/.ssh (generate it fresh or use existing user key) 在〜/ .ssh中安装用户密钥(公共和私有部分)(重新生成它或使用现有的用户密钥)

on cvs server: 在CVS服务器上:

  • install user key (public part) in ~/.ssh 在〜/ .ssh中安装用户密钥(公共部分)
  • add to authorized_keys 添加到authorized_keys

back on jenkins user account: 返回jenkins用户帐户:

  • access cvs from command-line as jenkins user and accept remote host key (to known_hosts) * note any time remote server changes key/ip you will need to manually access cvs and accept key again * 以jenkins用户身份从命令行访问cvs并接受远程主机密钥(至known_hosts) *请注意,每当远程服务器更改密钥/ ip时,您将需要手动访问cvs并再次接受密钥*

</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. 还有另一种方法,但是您必须手动从构建计算机登录到cvs服务器,并保持ssh会话打开,以便hudson / jenkins可以搭载该连接。 Seemed kinda pointless to me though since you want your CI server to be as hands off as possible. 对我来说似乎没有意义,因为您希望您的CI服务器尽可能地轻松。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM