How to get Hudson CI to check out CVS projects over 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.
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.)
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.
精彩评论