0

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?

Tim
  • 171
  • 2
  • 3
  • 8

3 Answers3

1

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?

gabbelduck
  • 329
  • 1
  • 3
1

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/

shadow_of__soul
  • 376
  • 1
  • 6
  • 16
  • 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 http://stackoverflow.com/questions/446518/using-svn-post-commit-hook-to-update-only-files-that-have-been-commited 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 06: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 05: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
0

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.

BoyMars
  • 1,012
  • 1
  • 6
  • 15