[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Hooks

From: Ravi Gehlot <ravi_at_ravigehlot.net>
Date: Fri, 17 Oct 2008 19:36:23 -0400

Hi David,

    First of all, thanks for helping. This question was actually
originated by my friend Eric Roberts. I also do not know how to fix this
problem. But here is a scenario: Let's say that we have 2 servers and
both servers have different IPs under the same subnet which makes them
members of the same network. Let's imply that we have SVN-Server
installed in both server-machines and that one of them is a DEV server
and the other is a TEST Server. How can I program my hook so that it
commits across that same network from IP1 to IP2 meaning from Server 1
to Server 2? I could be wrong but it looks like hooks only work with the
local protocol file:/// so how would I commit to a directory found in
another machine instead of some local directory on the same machine?

Ravi.

David Weintraub wrote:
> On Fri, Oct 17, 2008 at 5:15 PM, Ravi Gehlot <ravi_at_ravigehlot.net> wrote:
>
>> Can I use hooks to invoke an update when there is a commit on a repostiory
>> when the code and repo are on differnt servers (same network)?
>>
>
> A post-commit hook can be made to do just that. There has been several
> discussions on this very list about that type of hook. An easy way is
> to have the post-commit hook pass the svn update command as an
> argument to the "ssh" command. There are a few gotchas you do have to
> watch for:
>
> * Subversion doesn't complete the commit until the post-commit hook is
> done. Actually, the commit is completed, but the user doesn't have any
> way of knowing that because their command line client is waiting for
> the post-commit hook to return. To get around this issue, put the
> actual update in background in side the hook. That way, the user
> doesn't have to wait for the hook to complete.
>
> * You don't want to update a live webpage because at some point it
> will be unstable with 1/2 of the files being updated, and the other
> half being obsolete. A recommended strategy is to have your Apache
> root as a symbolic link pointing to the directory that contains the
> web content. You do a "svn export" to a new directory, then change the
> symbolic link to point to that directory.
>
> Personally, I am a bit weary about auto-updating webpages on every
> commit. My preference is to put the actual web page on a branch.
> Updating the trunk doesn't update the webpage, but allows you to do
> packaging and testing. Maybe the latest check in is not a good idea.
> After testing, you can post to the web-page branch which will update
> the webpage.
>
> This way, you have a bit more control over the webpage updates. I use
> to do the updates via a crontab instead of using the post-commit
> update hook. I would have the crontab run at a particular time during
> the day. This allowed me to take down the website for maintenance
> before I did the update, and made sure I didn't confuse any of my
> users.
>
> --
> David Weintraub
> qazwart_at_gmail.com
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-18 01:36:49 CEST

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.