如何让 Hudson CI 通过 SSH 检查 CVS 项目?

发布于 2024-08-29 22:01:53 字数 129 浏览 6 评论 0 原文

我有我的 Hudson CI 服务器设置。我有一个 CVS 存储库,我只能通过 ssh 签出内容。但我认为没有办法说服 Hudson 通过 ssh 签出。在提供连接字符串时,我尝试了各种选项。

有人这样做过吗?我想它已经完成了。

I have my Hudson CI server setup. I have a CVS repo that I can only checkout stuff via ssh. But I see no way to convince Hudson to check out via ssh. I tried all sorts of options when supplying my connection string.

Has anyone done this? I gotta think it has been done.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

放赐 2024-09-05 22:01:53

如果我还记得 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.)

素罗衫 2024-09-05 22:01:53

我写了一篇文章来解决这个问题,你可以在这里找到它:
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 用户帐户:

  • ~/.ssh 中安装用户密钥(公共和私有部分)(生成新的或使用现有的用户密钥)

在cvs 服务器上的

  • :在 ~/.ssh 中安装用户密钥(公共部分)
  • authorized_keys

添加到jenkins 用户上的 帐户:

  • 以 jenkins 用户身份从命令行访问 cvs 并接受远程主机密钥(到known_hosts)
    * 请注意,每当远程服务器更改密钥/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:

  • install user key (public & private part) in ~/.ssh (generate it fresh or use existing user key)

on cvs server:

  • install user key (public part) in ~/.ssh
  • add to authorized_keys

back on jenkins user account:

  • 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 *

</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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文