CruiseControl.net submit a file to SVN after a task has changed it

落爺英雄遲暮 提交于 2020-01-25 05:29:05

问题


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 updates 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?


回答1:


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




回答2:


There's another answer on stackoverflow about how to cfg cc to avoid the build cycle: How to checkin code during the build




回答3:


This question may help.

I gave up on the setup and deployment projects because of the VS dependency.




回答4:


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.



来源:https://stackoverflow.com/questions/3296616/cruisecontrol-net-submit-a-file-to-svn-after-a-task-has-changed-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!