tags:

views:

17

answers:

2

My project is divided into bunch of subprojects . I want to automate the process of getting all the changes from svn, building and deploying it . So i I want to build and deploy a project only if there were incoming changes from svn . Is there a way to automate this ? Note that I am using a windows machine ( unfortunately )

A: 

You can use SVN's post-commit hook feature.

This link explains how to send email after someone commits to the repository.

EDIT: Looks like you need a script in the local machine. What you can do is to create a batch file that runs the svn update and checks whether there are modified files.

To see whether there are modified files, you can check the first character of the output of svn update whether it begins with A (file added), D (file deleted), U (file updated), or G (file merged). I intentionally exclude the line that begins with C (conflict) because updates with conflicts (most likely) will not build.

Unfortunately, I can't give you any code since I'm not familiar with batch programming.

ryanprayogo
Thanks . Looks like this a svn server feature . I want something like that locally .I want to do this on my local machine ( client)
Surya
I updated my answer
ryanprayogo
A: 

If you can communicate with the server, then there should be ways the server can communicate with your client/local machine. ryanprayogo posted a link which demonstrates how to send email from the post-commit hook. So you can run a script on your local machine which monitors a special email account and activates the build process. There are much more options of notification mechanisms.

splash