Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've set up a repository to configure my websites, the repository is /subversion/web and at the moment I have just one website controlled in /subversion/web/mywebsite

I've set up a post-commit hook script that exports the site into a web directory on the server for testing before I publish it all separately and it works fine.

What I'd like to do is set the script so that I can control a second website in the same repository but only have 'mywebsite' export when I check in a file related to that project.

I've set it up this way because I access the repository from a number of computers via http, it makes it easier to create new projects without having to create a whole new repository and configure apache to point at it and all the rest of it.

latest svn running on latest ubuntu with latest apache2

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can do this using the "svnlook" command.

Here's an example post-commit hook:

#!/bin/sh
REPOS="$1"
REV="$2"
/usr/bin/svnlook dirs-changed -r "$REV" "$REPOS" | egrep -q '^mywebsite'
if [ $? -eq 0 ] ; then
    # publish site code
fi

You may need to run svnlook manually a few times to become familiar with the output and see how to set the match pattern for the grep.

share|improve this answer
    
brilliant, thank you –  MalphasWats Feb 13 '10 at 9:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.