You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Melanie McSally <mm...@gmail.com> on 2007/05/22 22:52:30 UTC
Run different post-commit hook script based on change
Is there a way to trigger different scripts to run from the post-commit hook
based on what was changed?
I have two scenarios:
1) When a commit happens on a branch I want the changes to be automatically
deployed to server a, but when a commit happens to the trunk I want the
changes to be automatically deployed to server b.
2) When a commit happens that involves changes to the web directory only, I
want server a to be automatically updated without a build, but when changes
happen to any other directory or file outside of web, i want a full build to
occur for server a.
I have builds and updates working from my post-commit hook, all I am looking
for is help on knowing what has changed so I can trigger the correct script
to run.
Does anyone know how to do this, or if this capability even exists?
Re: Run different post-commit hook script based on change
Posted by Ryan Schmidt <su...@ryandesign.com>.
On May 22, 2007, at 17:52, Melanie McSally wrote:
> Is there a way to trigger different scripts to run from the post-
> commit hook based on what was changed?
>
> I have two scenarios:
> 1) When a commit happens on a branch I want the changes to be
> automatically deployed to server a, but when a commit happens to
> the trunk I want the changes to be automatically deployed to server b.
> 2) When a commit happens that involves changes to the web directory
> only, I want server a to be automatically updated without a build,
> but when changes happen to any other directory or file outside of
> web, i want a full build to occur for server a.
>
> I have builds and updates working from my post-commit hook, all I
> am looking for is help on knowing what has changed so I can trigger
> the correct script to run.
>
> Does anyone know how to do this, or if this capability even exists?
Sure. Well, Subversion will always call a single post-commit hook, so
you need to write that script to react differently depending on what
was changed in the repository. Use "svnlook changed" or "svnlook dirs-
changed" in your post-commit hook to discover what changed.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org