Re: Post-commit hook tutorials?
From: Robert Denton <robert_at_headsprout.com>
Date: Tue, 04 Mar 2008 15:04:20 -0800
Thanks everyone for the terrific input. Here is how my solution took form:
Instead of having the hook directly copy the file in question to the windows server, all I needed to do was determine what was committed and then pass that in a URL var to a cold fusion page. I am fortunate in that I am surrounded on all sides by CF guys who love to do everything in CF. Simplifies my job quite a bit.
First the hook script doesn't do any work itself, it just calls other scripts:
[rogerroger_at_svn etc]# more /svn/repos/RIPgaryg/hooks/post-commit
REPOS="$1"
/svn/etc/svnsync.sh
As far as the sounds script goes, the general consensus was dead on: svnlook is the ticket:
use LWP;
$repo = $ARGV[0];
@changes = `svnlook changed $repo -r $rev`;
while (@changes) {
sub sound2fusion {
$HTTPrequest = HTTP::Request->new(GET => $uri);
$fail_string = "The file $_[0] was committed but the call to $uri failed. The HTTP Response was: " . $HTTPresponse->status_line;
if (!($HTTPresponse->is_success)) {
#print " ***> HTTPResponse: " . $HTTPresponse->content . "\n";
} # end sub sound2fusion
Something less than polished at this point but it is doing exactly what I need it to do. I thought I'd offer it up for anyone who needs a similar solution in the future. Thanks again!
Robert
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.