update-website.mk make script ready

Anderson Lizardo lizardo at linuxfromscratch.org
Wed Aug 11 11:41:36 PDT 2004

On Wednesday 11 August 2004 10:48, Jeroen Coumans wrote:
> Anderson Lizardo said the following on 11-08-2004 01:24:
> > I've already created a small hook script, located
> > at /home/lizardo/scripts/update-website-hook.sh, that will be called by
> > subversion right after a commit. This script will be moved to a more
> > standard location (possibly /usr/bin) after the tests.
> Agreed. It might be a good idea to use a "caller"-script though. At
> work, I did it like this:
> #!/bin/sh
> # [1] REPOS-PATH (the path to this repository)
> # [2] REV (the number of the revision just committed)
> /usr/local/bin/post-commit-X "$1" "$2" >> /var/log/subversion/X-${2}.log
> 2>&1
> This also captures the output of the post-commit script so you can debug
> it (there's no other way to capture the output, unfortunately).

Well, If you mean the "caller script" something like 
the /usr/bin/run-update-website.sh which fetch and calls update-website.sh to 
do the real job, I think  /home/lizardo/scripts/update-website-hook.sh does 
exactly this. I've just added some validation code to it (so I can call it 
manually while the post-commit script is not up), but I'll remove it to make 
the script more simple.

Indeed, we need to have some way to capture possibly error messages. What 
about additionally mailing the output to this list only in case there is some 
error? I mean something like:

if update-website.mk &> /var/log/subversion/update-website.log then
	<mail command> < /var/log/subversion/update-website.log

This would substitute the cron messages Gerard forwards to us when there is an 
Anderson Lizardo
lizardo at linuxfromscratch.org

More information about the website mailing list