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

RE: Hooks

From: Eric Roberts <owner_at_threeravensconsulting.com>
Date: Fri, 17 Oct 2008 19:32:20 -0500

Sort of...the dev, test and production servers are separate from the repo

I responded earlier, but I don't see my reply...so here it is...

I actually originated the question with my friend Ravi here, so let me

Our repo is on it's own server on our network.

I develop locally then commit that to the development branch and I have to
remote in to update the dev server (which is checked out from the dev
branch). When I am confident that all is well on dev, I merge the changes
to the test server. The I have to do an commit on the test server to put
that into the test branch. Once everything is tested and good to go, I
merge it to the production and then that gets committed to the trunk. So
for the most part, there isn't a commit for every change...just he release +
any updates for bugs. Usually it is just dev that has the bulk of the
smaller commits as I test and big fix on dev. Test might have some smaller
commits from fixes and Prod generally just has the releases.

I would like to automate the updates and commits on dev, test and


/*-----Original Message-----
/*From: Ravi Gehlot [mailto:ravi_at_ravigehlot.net]
/*Sent: Friday, October 17, 2008 6:36 PM
/*To: David Weintraub; users_at_subversion.tigris.org
/*Subject: Re: Hooks
/*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?
/*David Weintraub wrote:
/*> On Fri, Oct 17, 2008 at 5:15 PM, Ravi Gehlot <ravi_at_ravigehlot.net>
/*>> Can I use hooks to invoke an update when there is a commit on a
/*>> 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

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 02:33:04 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.