I am trying to create a NAnt script that would be triggered after a folder is created in the Tag folder of the SVN. The script would then get the contents of the working copy into the newly created folder in Tags and start the build. Pls help me if anyone can
1 Answers
It's too late to do a build once you create a tag. What if you have a build issue? Instead, you should build upon a branch or trunk, and then, if that build is good, tag that revision of the branch or trunk.
Take a look at Jenkins. This is the most popular continuous integration tool. You can setup Jenkins, so every time you commit a change in your code, Jenkins will spawn build with that change. Jenkins can even run automated tests for you. If there's a problem, Jenkins can email the project leads and the developer who made the change.
You can store the built artifacts you need to run right in Jenkins, and Jenkins can be setup to do automated deployments if you so desire.
What you don't want is a Subversion hook that would do a build for you. Otherwise, the user doing the commit is locked up until the build is complete. You'll end up with more massive changes since developers will become reluctant to do commits.

- 105,218
- 39
- 216
- 337
-
Right now, I am able to run my NAnt script on every commit with the help of post-commit.bat, that would copy the contents of the working copy into the Tags/Revision # folder . What I wana do is, When I create a folder in the Tags, I should run a NAnt script that would get contents of the latest working copy into the newly created folder. Basically, I want to separate the commit part with the tagging part. But I am not able to do it as I am using post-commit.bat that would run on every commit...Is there any other way to achieve my goal? – user2495326 Jun 18 '13 at 19:03
-
As I said before, you don't want to run your NAnt script with every commit using a post-commit hook. The user doing the commit has to wait for the post-commit script to finish before they can continue. You also don't want your post-commit hook to commit a change in the repo (which a tag would do). It would cause your post-commit hook to fire up again and again. Look at Jenkins. It's a snap to setup and easy to use. – David W. Jun 18 '13 at 19:09
-
Hey David I do understand what you are trying to say . But I am trying to do is, I will be using a NAnt script using post-commit hook to send out email notifications and a SEPARATE NAnt script WITHOUT using post-commit hook to create a folder in the Tags and transfer the contents of the working copy into the newly created folder. So I will be using two scripts. I wanted to know is there a way to trigger my second NAnt script when i create a folder in the tags without the use of post-commit hook?? – user2495326 Jun 18 '13 at 19:29
-
You could create a web service that you trigger with a GET request to a particular URL. When your web service detects that GET request, it would run your Nant script. [Jenkins](http://jenkins-ci.org) can already do this. I highly recommend ***NOT*** to store build results in your repository. Build results take up a ton of room, and become obsolete very quickly. Your repo will be 95% builds and 5% source code and take up terabytes of space. Use Jenkins archive artifacts feature to store your builds, and delete them when they're no longer needed. – David W. Jun 18 '13 at 20:31
-
Thanks alot for your help..Appreciated :) – user2495326 Jun 18 '13 at 21:44
-
Any idea how to use substring in NAnt ? I am completely new to NAnt scripts. I am not able to use the substring function. This is what I am trying to do but with no luck :
– user2495326 Jun 18 '13 at 21:46