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.

We have a SVN server (UberSVN) and we have a test server (Ubuntu 11.10). Test server is running SVN-client and LAMPP.

We were looking for a solution that auto update the working copy's our developer on Test Server as soon as someone commit the changes to SVN server.

How to auto update working copy svn when someone commit ?

share|improve this question
    
Which OS your production server is running: Windows or Linux? –  quanta Sep 26 '12 at 7:49
    
Hi quanta, Server is Ubuntu 11.10 ( have SVN-client and LAMPP) –  dakiquang Sep 26 '12 at 8:04
2  
Google post-commit hooks, then try it first and let us know if you get any problem. –  quanta Sep 26 '12 at 8:08
    
HI quanta, I need config post-commit hooks on SVN server to update to Test Server. SVN server and Test Server are two separate servers –  dakiquang Sep 27 '12 at 3:25
1  
I know that. In the post-commit hook: all you need is setup an password-less account to ssh from production server to test server and do a svn update. –  quanta Sep 27 '12 at 4:26

2 Answers 2

A few options spring to mind

  1. Take the simple sledge hammer approach of having a simple cron job that does and SVN update every few minutes on the test server.

  2. Use an SVN Post-commit hook on the SVN server to signal to the Test server that a commit has taken place so the test server can update. Signaling could be simply by placing a file in a shared location that the test server looks for in a script.

  3. Use a proper "Continuous integration" server such as http://jenkins-ci.org/.

Option 2 would need a bit of work in terms of writing some scripts but shoudl be fairly straight forward.

share|improve this answer
    
I'm interested in option is Use an SVN Post-commit hook on the SVN server to signal to the Test server. But, I don't know how to config SVN Post-commit hook on SVN server to update to Test Server. Can you help me more about SVN Post-commit hook to another server ? Or document about it. –  dakiquang Sep 27 '12 at 3:19

I had used No 2 that Phil has mentioned.

What I configured was I made a Working copy on the svn server for every repository just to as for Auto Deployment.

So whenever someone commits to a repository my post-commit script updates the working copy and then the working copy is rsync'd to the Client's Servers using a cron that used to run every 2 mins to rsyen the working copy among different client machines.

I was using Subversion. Here are the commands that I used.

  1. svn co file:///path/to/$SvnRepoName /working/$ProjectName --> A local working copy on svn server

  2. /usr/bin/svn update /working/$PROJECTNAME --> in my post-commit script.

  3. A shell script to rsync /working/$PROJECTNAME among client machines.

share|improve this answer
    
Nice way of doing it with rsync. Neat –  Phil Sep 26 '12 at 9:45

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.