[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS & a Web site

From: Eugene Grosbein
Subject: Re: CVS & a Web site
Date: Thu, 18 Oct 2001 09:54:02 +0800

Jason Purdy wrote:

> What is a good scheme of automating synchronization between a CVS repository
> and a Web site (or does a repository have to be separated from the Web site
> files [besides renaming the files from the ",v" suffix])? 

Renaming files won't work.
And yes, repository must be separated from Web contents

> A co-worker & I
> have recently decided to work with CVS on our ever-growing Web site, and I've
> got CVS up & going, but lack an important piece of the puzzle - getting data
> out of the repository and into the Web site (hopefully in an automated
> fashion).
> I have a couple of ideas, but before I go down a road that's surely been
> traversed before, I'd love to get some input from the more travelled on the
> list.  I hope there's already a solution for this scenario, though I couldn't
> find anything on the Web site or in a Google search.
> Thanks,
> Jason
> PS: Here are some of my ideas:
> 1) Create a Perl script/Cron job (run every 15 minutes) which would basically
> 'cvs history -a -c -D "15 minutes ago"', parse that and affect the Web site
> directories accordingly.
> 2) Create 'trigger' scripts which would be triggered when the developer
> 'commit'ed their changes, which would also affect the changes on the Web site
> directories.

I prefer a trigger. We maintain our Web site using CVS.
Web site contents is owned by user web. So, for first time
I login as web, go to DocumentRoot of site and run
cvs -d $MYCVSROOT checkout. Later it's content will be cvs update'd by 

I use CVSROOT/loginfo to assign triggers to several parts of site.
Example line in loginfo:

links /usr/local/adm/update.links

When 'links' directory is updated in CVS, noted script is started.
Example contents of script:


( export TMPDIR=/var/tmp
  cd /my/doc/root/links
  sleep 1 # wait for lock to be released
  sudo -u web /usr/bin/cvs update -P -d 2>&1 
) &

It's simple example and it can be impoved, of course.
I give my co-developers right to execute /usr/bin/cvs update -P -d
as user web via sudo.

Eugene Grosbein

reply via email to

[Prev in Thread] Current Thread [Next in Thread]