0

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 ?

5
  • Which OS your production server is running: Windows or Linux? Commented Sep 26, 2012 at 7:49
  • Hi quanta, Server is Ubuntu 11.10 ( have SVN-client and LAMPP) Commented Sep 26, 2012 at 8:04
  • 2
    Google post-commit hooks, then try it first and let us know if you get any problem. Commented Sep 26, 2012 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 Commented Sep 27, 2012 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. Commented Sep 27, 2012 at 4:26

2 Answers 2

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.

1
  • 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. Commented Sep 27, 2012 at 3:19
1

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.

1
  • Nice way of doing it with rsync. Neat Commented Sep 26, 2012 at 9:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.