somewhat daily mutterings

/Computing CVS Server Set Up at Home

I've been working on my weblog engine, gemcast, for some time now, and doing so without any version control whatsoever (other than backups). It's worked out fine so far, but now I've got the iBook in addition to my G4 desktop and I really need to be able to work from either machine. I recently set up both machines as web development environments, with identical configurations (previously, I was pushing changes to a test instance of gemcast on my production web server). Even though each machine is now set up to do development, to switch between the different machines without version control would be insane. So, I made up my mind to set up a CVS repository for development.

I've used CVS on several projects, but always in "local" mode, where all the developer accounts are local to the CVS repository. In this case, I have two development boxes, neither of which can really hold the CVS repository because that box would have to be on in order to access it from the other box. Therefore, I decided to set up one of my Sun boxen as the CVS repository "server". This was actually pretty simple -- no daemon process or init scripting involved!

Here's how I did it:

  • I installed CVS using the normal configure/make routine. I then set up a CVS user on my sun box, and initialized a repository in that user's home directory.
  • I decided to use the 'rsh' style of remote CVS access because it's pretty simple. I just had to put an .rhosts file in the cvs user's home directory on the Sun box, containing the machine names and users (my two Macs, and my normal login user) to which I'm allowing rsh access. I tested a couple of rsh commands to ensure that it was working.
  • Now that I had rsh access, I could run CVS. CVS has a syntax for rsh-style access, but it's not something I want to type very often, so I wrote myself a script like so:
    export CVS_SERVER=/usr/local/bin/cvs
    cvs -d :ext:cvs@buzz:/export/home/cvs/repo $*
    
    The first line is essentially a "remote path" to let the local CVS know where the remote CVS is located. The second line is the ugly rsh CVS command line.
  • I imported the gemcast code from my PowerMac desktop to the CVS repository with the normal CVS syntax:
    cvsbuzz import gemcast start r1_0
    
    ('cvsbuzz' is the name I gave my script). CVS imported the module without drama, and I was ready to rock with 'cvs checkout' on both Macs.
  • I finished up by setting up an NFS share for the cvs home directory, creating a mountpoint on the PowerMac, and writing a backup script that pulls the CVS repository over to the PowerMac as a .tar.gz file. My backup scripts are scheduled in cron, and put their output in a /data/backup directory that is included in the OS X Backup utility's list of directories. Every few weeks I do a full backup to CD-ROM. Even though I don't run backups that often, with the storage redundancy my code is pretty safe.

Posted: Mon Aug 11 21:31:44 -0700 2003

Thanks for visiting! Send comments to Mike Thomas.

Site 
Meter