Simplest Enterprise Continuous Integration Solutions

Saturday, May 12, 2012

Enterprise Linux: Subversion Edge + SSH

Subversion Edge does not have plans to ever support svnserve. 
In order to enable CollabNet Subversion Edge implementation working for svn+ssh, a compatible svnserve from http://www.open.collab.net/downloads/subversion (i.e.  CollabNetSubversion-server-1.7.5-1.x86_64.rpm) is required.

# get a compatible svnserve from CollabNetSubversion-server-1.7.5-1.x86_64.rpm

[root@linux64-svn-server ~]# rpm -Uvh CollabNetSubversion-client-1.7.5-1.x86_64.rpm
warning: CollabNetSubversion-client-1.7.5-1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 35bcca43
Preparing...                ########################################### [100%]
   1:CollabNetSubversion-cli########################################### [100%]
[root@linux64-svn-server ~]# rpm -Uvh CollabNetSubversion-server-1.7.5-1.x86_64.rpm
warning: CollabNetSubversion-server-1.7.5-1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 35bcca43
Preparing...                ########################################### [100%]
   1:CollabNetSubversion-ser########################################### [100%]
[root@linux64-svn-server ~]# echo $PATH
/opt/csvn/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@linux64-svn-server ~]# mv /opt/CollabNet_Subversion/bin /opt/CollabNet_Subversion/bin_orig
[root@linux64-svn-server ~]# mkdir /opt/CollabNet_Subversion/bin
[root@linux64-svn-server ~]# cp /opt/CollabNet_Subversion/bin_orig/svnserve /opt/CollabNet_Subversion/bin/

# make sure get right path

[root@linux64-svn-server ~]# which svn
/opt/csvn/bin/svn
[root@linux64-svn-server ~]# which svnadmin
/opt/csvn/bin/svnadmin
[root@linux64-svn-server ~]# which svnserve
/usr/bin/which: no svnserve in (/opt/csvn/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) 

# create a wrapper for svnserve

[root@linux64-svn-server ~]# vi /opt/csvn/bin/svnserve
#!/bin/sh
# set the umask so files are group-writable
umask 002
# call the 'real' svnserve, also passing in the default repo location
exec /opt/CollabNet_Subversion/bin/svnserve -r /opt/csvn/data/repositories "$@"
[root@linux64-svn-server ~]# ln -s /opt/csvn/bin/svnserve /usr/local/bin/svnserve
[root@linux64-svn-server ~]# chmod a+x /opt/csvn/bin/svnserve
[root@linux64-svn-server ~]# which svnserve
/opt/csvn/bin/svnserve

# add csvn group as supplementary group for svn_user

[root@linux64-svn-server ~]# useradd svn_user
[root@linux64-svn-server ~]# usermod -a -G csvn svn_user

# generate SSH public/private key pair

[root@linux64-svn-server ~]# su - svn_user
[svn_user@linux64-svn-server ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/svn_user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/svn_user/.ssh/id_rsa.
Your public key has been saved in /home/svn_user/.ssh/id_rsa.pub.
The key fingerprint is:
3f:d2:80:d9:60:e6:18:b6:2e:55:2d:e1:b5:8a:f8:b9 svn_user@linux64-svn-server
[svn_user@linux64-svn-server ~]$ cd /home/svn_user/.ssh/
[svn_user@linux64-svn-server .ssh]$ cat id_rsa.pub >> authorized_keys
[svn_user@linux64-svn-server .ssh]$ chmod 600 authorized_keys

# svn+ssh check out source codes no password

[svn_user@linux64-svn-server ~]$ svn co svn+ssh://svn_user@linux64-svn-server/my_test/branches/devs/rel_2_1




No comments:

Post a Comment