Can I have multiple Triggers in Cruise Control? - cruisecontrol.net

At the moment I have
<!-- Builds Every 300 seconds the condition is set to if a modification exists -->
<triggers>
<intervalTrigger name="continuous" seconds="300" buildCondition="IfModificationExists" />
</triggers>
and I'm just wondering can you have multiple triggers inside the ccnet.config and can you set it so you only execute certain parts e.g, if a modification changes on the svn client, run one part of the config. and every night at 12 o'clock force a nighty build and deploy an msbuild to Octopus or does the whole ccnet config run when a build condition is triggered.

You can use MultiTrigger, which basically groups several triggers, as what you described, see here:
http://cruisecontrolnet.org/projects/ccnet/wiki/Multi_Trigger

Related

How to run an action / script after files all files are copied to target install dir?

Due to the buggy nature of InstallShield, it is incorrectly modifying my app.config files replacing <clear /> with <clear></clear>
After my app.config file is copied to install path, I want to run a custom action that can scan for all config files and do a standard find and replace.
I don't need code for the find and replace, what I want to know is how / where to put this custom action using Installshield?
Your best bet would be creating a deferred execution custom action and place it near the end of the execution sequence. This will guarantee it would run after the files have been installed.
In the 'Custom Actions and Sequences', Create a new custom action of the appropriate type (depending on your implementation of this replacement action). Set it's In-Script Execution to 'Deferred' and in the Sequence section have add it to the Install Exec Sequence, After ScheduleReboot.
The easiest way to modify config/ini files after deployment of files is the option of INI File Changes or Text File Changes under the System Configuration tab. You can mention the config file location and the replacement changes that you want to perform. Please refer this link.

Website project: want to generate XML documentation on build

For legacy reasons, I'm maintaining a Web Site Project for which I want to provide up-to-date documentation from the XML documentation comments. I gather I can do that by tweaking the <compilers> section in web.config. I finally reached this point:
<system.codedom>
<compilers>
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider"
compilerOptions="/optimize /doc:C:\temp\my-output-here.xml"
warningLevel="1" />
</compilers>
</system.codedom>
Now when I start the website with (and thus invoke just-in-time compilation) I do get an XML file in the requested location but it's minimal:
<?xml version="1.0"?>
<doc>
<assembly>
<name>App_global.asax.abqhzva4</name>
</assembly>
<members>
</members>
</doc>
It seems like the <compiler> tag doesn't quite do what I want. It must be generating XML for the project folder itself rather than the .cs files, or it's getting overwritten with each compilation unit and I'm only seeing the trivial last one, or... I don't know. I'm not sure. This config tag is not well documented.
Long story short, I'm looking for a way to get XML documentation for all the .cs files in this website project. It doesn't matter if it's all in one file, in separate files, or even shoved into memory at run time.
I'm aware of the prior question on this, but the link provided there has been redirected to the Sandcastle site. That's great, but it's way more than I'm actually going to use on this project. Simply getting XML documentation at build time or run time is all that is necessary.
My question then is: What do I need to do to get the <compiler> config entry to generate XML docs for a Website Project?
I have an ugly workaround as well... But here goes!
1. Download the latest Sandcastle Installer from this page - https://github.com/EWSoftware/SHFB/releases
2. Unzip and run the installer
3. Copy EWSoftware.CodeDom.dll into your website's \bin directory. The default location of this file is - C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\Extras\EWSoftware.CodeDom.dll
4. Modify web.config as follows:
<configuration>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
compilerOptions="/docpath:C:\Publish\Docs"
type="EWSoftware.CodeDom.CSharpCodeProviderWithDocs, EWSoftware.CodeDom"
>
<!-- NOTE: Change version value as needed (v3.5, v4.0, etc.) -->
<providerOption name="CompilerVersion" value="v4.0"/>
</compiler>
</compilers>
</system.codedom>
</configuration>
Source: http://ewsoftware.github.io/EWSoftwareCodeDom/html/40ba6bda-95d6-4a64-834f-f7cedcb589d1.htm
5. Rebuild your solution and voila! The folder specified with the /docpath option will contain your XML documentation.

Custom Build Action for sqlproj

I came across this article which will add a custom "Build Action" option to the properties window for csproj. However, I would like to have a custom Build Action for the objects in a database project. Is there something I can add to the .sqlproj file that can do something similar? Can I add a custom Build Action at all for SQL?
You can edit sqlproj file and add your own msbuild target to it. It'll be equal to post\pre-build action.
Edited:
.SQLProj file is actually MSBuild script file (if we are both talking about SSDT SQL Database project one :)). So you can open it in any text editor and add something like this:
<Target Name="PreBuildEvent" AfterTargets="PrepareForBuild">
<Exec WorkingDirectory="$(OutDir)" Command="calc.exe" />
</Target>
It'll be very close to the way how PreBuild command being executed to build process.
Check that PrepareForBuild target is being called during your build process or change it to any other you want. You can go further and extend your build process with any msbuild tasks you want.

Cruise Control .Net - Turn off Versioning

Every time cruise control performs a build it update the history of each file with a label, i.e. update to version 14, etc.
How can I turn this off so that it does not update the files and just performs the build?
First check if you have a <labeller> block somewhere in the config file. If you have, this overwrites the default labeller, which simply distinguishes one build from another.

CruiseControl.NET parameter passing

I have a CruiseControl.NET ccnet.config file, which monitors two different projects in the same project scope. If one of them changes, it has to trigger a build. But I wanted to know which project has been changed among the two. I have to pass them as a commandline parameter. Is there any built-in property?
Splitting the project to two projects seems like the right thing to do.
Specifically, split to to projects and add a Project trigger for the DML project.
This way if the table scripts are to be changed, both projects will be triggered and if only some DML statement changes, only the second project will be triggered.
In case both projects have common trigger then i recommend using a synchronization queue.
<queue name="Q_Synchronizer" duplicates="UseFirst" />
<project name="project1_name" queue="Q_Synchronizer" queuePriority="1">project stuff...</project>
<project name="project2_name" queue="Q_Synchronizer" queuePriority="2">project stuff...</project>
HTH

Resources