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.

Possible Duplicate:
Subversion post commit hook checkout to website document root

We have setup Subversion on our Debian development box, we have also setup a post-commit hook that will svn update the repository out to /var/www/ourwebsite

The problem is that there are around 2GB of files in our repository and were working on files/changes all day and committing quite regularly, it's putting a huge load on the server and it also takes ages to complete and reducing our productivity

If its just subversion, that's ok, but I have a feeling this is not the best setup hence why each commit is taking so long

Any suggestions?

share|improve this question

marked as duplicate by Chris S Feb 17 '12 at 16:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers 3

up vote 1 down vote accepted

this can help you :D

http://shadow.y-developments.info/shadow_of__soul/2010/08/update-web-directory-after-a-svn-commit-the-final-solution/

share|improve this answer
    
This is what im looking for but I cant manage to get it working. The output of the svnlook is a single string like /trunk/dir1/dir2/dir3 and so I dont think the program is handling that, I dont really have the C experience to modify the program to split the string out. This post stackoverflow.com/questions/446518/… seems to outline a way to do it just in the post-commit hook but I cant seem to get that working either. The main issue is the number of files and the time its taking to process them. –  Tim Sep 13 '10 at 6:35
    
the svnlook will give you a path relative to the repository, i have the same problem but like i said in the post, i solved using sed, so in the post-commit file, after you make the svn look, make something like this: sed -i 's/svn_path_to_replace/your_web_path/g' /tmp/dirschanged if the paths to replace are different, put several sed lines :) advise if you still have problems. –  shadow_of__soul Sep 13 '10 at 11:05
    
Im not very familiar with 'sed'. However, I want to confirm that the svnlook is working correctly. As I said, in the post-commit hook, we run an svnlook -dirs-changed and output that to /tmp/dirschanged - The output of the file is on a single line, are you saying I should use sed to break this line into the different paths? –  Tim Sep 13 '10 at 22:59
    
ok I figured out what I needed to do. Used sed to substitute the correct path, didnt need to use the C program I just passed to xargs | svn update etc.. –  Tim Sep 14 '10 at 5:39
    
yes, the C program is needed only when the files in web root are not owned by subversion or apache (the user that execute the post-commit hook). you can run the svn update from the post-commit hook and passed the arguments from the svnlook to the command :) glad that i could helped :D –  shadow_of__soul Sep 14 '10 at 13:58

Step 1 - confirm that it's the post-commit hook that's taking so long.

Step 2 - if it is the post-commit hook - look at exactly how you are doing it - are you doing a complete checkout every time, or just an update, or what? A checkout is going to be slow at that size. An udpate should be quite fast.

It really depends what your goal is regarding deployment - can you de-couple deployment from commit? Could you use something like Webistrano/Capistrano or roll your own "deploy" button?

Have you tried disabling the post-commit hook to determine if that's part of the slowdown or not?

share|improve this answer

we use a similar solution in an 8GB+ repository, although after doing one large checkout i loop through the files that were changed and only update them. we have a large number of files and even svn update took a long time to complete.

i was attaching diffs to an email for the changes too but this added about 10secs for each commit.

share|improve this answer

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