CruiseControl.net submit a file to SVN after a task has changed it
I have a CruiseControl.NET powered build server and an exec task that increments assembly version of the project before building it. I was wondering, was there a way (a CruiseControl.NET task I don't know about) to submit that modified file back to SVN?
I need it so when the setup projects are built manually (I am using msbuld so those aren't built continuously) all the build files will have the correct assembly versions on deployment. Oh and if someone knows how to build setup & deployment projects on a build server without Visual Studio installed, I'm dying to know!
EDIT: Thanks to Jonathan Stanton the update now works, however it creates another problem... The build server now loops (on change it upda开发者_JAVA百科tes assembly version and commits the file. This caouses the onModify trigger to fire so it updates assembly version and commits the file...).
What can I do so it won't loop? Can I add an update SVN task? Will that help?
The following task will commit back the a file in to the source repo.
<exec executable="svn.exe">
<buildArgs>commit -F <file you want to commit back> --username USER --password PASS --no-auth-cache --non-interactive --message 'CruiseControl.net build %CCNetLabel%'</buildArgs>
<buildTimeoutSeconds>10</buildTimeoutSeconds>
</exec>
The following links may be of use:
- CruiseControl.NET: Executable Task reference page - This has a list of all the labels that you can pass through to the exeternal program which you will ba able to use to build the path to the file you are committing back.
- SVN Commit command line reference - For all the options that you can pass through to the SVN command line client.
I hope that this helps
Jonathan
EDIT
There is another way to do this and that is to allow CC.NET to set the build version in the DLL. There is a walkthrough on how to do this at Damir's Corner entitled Setting Up SVN and CC.NET for .NET Development
There's another answer on stackoverflow about how to cfg cc to avoid the build cycle: How to checkin code during the build
This question may help.
I gave up on the setup and deployment projects because of the VS dependency.
In the post on my blog which Jonathan linked to in his answer I described my setup which doesn't do any commits during the build process. Instead of increasing the build number during the build I just use the revision number from Subversion. I prefer it this way because based on the build number I can easily retrieve the sources that where used to make the build.
Ths works great in my case where all the builds are done on CruiseControl.NET. Building setups manually is more tricky in this case because the files in Subversion don't have the correct build number. You could circumvent this problem by using the already modified files from CruiseControl.NET build and use them to build your setup. Or you could just build the setup continuously as well.
If this doesn't work for you, you should take the Filtered Source Control Block path suggested by DilbertDave. Just put your AssemblyInfo.cs file (or any other files you modify in the build process) in the exclusionFilters to get rid of the build loop.
精彩评论