I have a large web project and I would like to publish only the files that were modified by the last checkin. What would be the best way to do this?
I found an article that detailed the process using robocopy. I thought perhaps there was a task in ccnet that did this, but I couldn't find one.
http://msmvps.com/blogs/omar/archive/2008/10/06/asp-net-website-continuous-integration-deployment-using-cruisecontrol-net-subversion-msbuild-and-robocopy.aspx
It depends on what you are doing. Do you use a build script? Your best bet is to let your build script do your publishing, you will have much more control over it.
There is a Modification Writer Task that will create an XML file of the detected modifications in that build. You could then have your build script read that and publish just those files.
There is also a Modification Reader and the doc implies that you can use the read in modifications and publish based on that list:
The ModificationReaderTask can now easily read the modification
file(s) made by project one, into it's
own integration,
making it possible that these can be used by the existing
tasks/publishers of ccnet for project
2
However, it doesn't make it to obvious how you would do this. Perhaps the BuildPublisher will use the Modification Reader info. This might get you started.
Related
I'm trying to set up a build definition for a solution that has multiple web projects in it, but I want a specific one to be deployed as a result of a build (as far as I understand it takes the first web project). I know that there has been discussions around that issue but these discussions are quite old now. I wonder if there is still no solution.
Take a look at customizing deployments using a .deployment file
Basically to achieve what you want you would need to create a .deployment file in the root of your repo that contains something like the following
[config]
project = MyOtherWebProject/MyOtherWebProject.csproj
I'm using cruisecontrol.net to do CI, but the test type is configured in an xml file is not what I want. The xml file looks like:
<config>
<Test type="A"/>
</config>
Is there any way to change it from A to B?
I would switch mentality a bit.
Think of CC.NET as a "super fancy msbuild.exe executor".
Write most of your logic in msbuild files. Then you can easily find XmlPeek and XmlPoke (XmlUpdate) "extension tasks" that are tried and true.
This has some advantages. If you ever switch from CC.NET to something else (TFS for example), having most of your logic in an msbuild (.proj) file will make that transition very easy.
The more "proprietary" tasks you write that is CC.NET specific, the deeper you get in.
I go with this:
Have CC.NET download your .proj file.
Have CC.NET excecute msbuild.exe yourfile.proj.
Have CC.NET "merge" all resulting xml.
Have CC.NET run its "publishers" (email being the most popular)
Your .proj file will have the majority of logic.
It will pull down the rest of your code.
It will build the code.
It will zip up files or create installers or whatever.
This will serve you better than trying to get CC.NET to do everything.
I don't think there is CC.NET xml-update task.
Msbuild Community Tasks has ~lots of extra tasks to get done what you want to get done.
Yes there is with parameters. See this page:
http://cruisecontrolnet.org/projects/ccnet/wiki/Parameters
When someone forces a build a dialog pops up allowing them to choose between test type A and test type B.
Is there any way that NANT would do a force checkout from source control or force checkin even if there is newer version in source control?
I not an nant guy, but could you explain what is the purpose of it?
Forcing checkin automatically looks to me like a bad idea - if I modified file by mistake I don't want it to be automatically checking without my innervation.
If you were using a CruiseControl.NET source control block then you could specify cleanCopy="true" to delete the working copy before updating the source.
I assume you want to circumvent the normal CruiseControl.Net checkout mechanism? You will have to execute the source control command line yourself, or use something like NAntcontrib.
Please specify what source control engine are you using.
I've been doing some research into finally automating our Development builds and still have one nagging question that I'm hoping the StackOverflow community can solve for me.
My understanding is that an IntervalTrigger when setup properly will check VSS every X seconds for changes and if it finds a modified file, will run my tasks. One of my tasks would be to checkout the AssemblyInfo files and update the version numbers. After these files are updated they would be checked back into VSS.
Thinking about this solution it doesn't make much sense because in my mind, I'm forcing the check for changed files to true every time the trigger fires. Am I missing something here? Is there a way of doing this without triggering an automatic build on the AssemblyInfo check-in?
You can use a Filtered Source Control Block to exclude certain files from the trigger.
I just posted a bunch about my default build process here which may be of some interest to you: SVN Website Development and Deployment Solution
The way I usually configure my projects with CC.NET is to have two project blocks per solution. One configured as an interval trigger that does nothing more than get the latest from my repository, build the solution, and run unit tests. The other is a schedule trigger that does all the things the other one does, but actually publishes a build. This includes changing version numbers, publishing files, etc. This might work in your case, since the change in version would cause the interval project to trigger, but only once.
Checking the automatically generated AssemblyInfo into the version control system is a bad idea, don't do it. You'll get a lot of noise (50% of all commits!) in your history. Also, it does not give you any new information - you can always pull this from VCS. Have your build script autogenerate those files is a good practice, but don't push those changes back!
I was wondering if it is possible if I could include a Fix List with my deployment build email notification,what I was expecting is I would add the latest changes to a text file stored in a directory and CruiseControl.NET would pick it from there and send along with the email.Anybody has any similar solutions, or how did you do it? Any samples or links?
Thanks in advance.
The first question is whether you do continuous integration (CI) builds or just periodical builds? In case it is CI, have you tried writing this fix list into the check-in comment of your version control system? CCNet shows this comment as part of the build report (and email notification).
UPDATE: the other option I see is to write your own CCNet plugin for this. It shouldn't be too hard. As a reference on writing CCNet plugins you can use my own BrekiLabeller plugin.