[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 17:09:28 -0500

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

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
production.

/*-----Original Message-----
/*From: David Weintraub [mailto:qazwart_at_gmail.com]
/*Sent: Friday, October 17, 2008 4:33 PM
/*To: ravi_at_ravigehlot.net
/*Cc: users_at_subversion.tigris.org
/*Subject: Re: Hooks
/*
/*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

---------------------------------------------------------------------
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 00:09:54 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.