What you want to do is use CC.Net Configuration Preprocessor
I made an email.config
<cb:define name="email-template" xmlns:cb="urn:ccnet.config.builder">
<email from="buildadmin@server.com" mailhost="server" includeDetails="TRUE"
mailhostUsername="buildadmin" mailhostPassword="pass">
<users>
<user name="dev" group="dev" address="dev@server.com"/>
</users>
<groups>
<group name="buildmaster" notification="always"/>
<group name="developers" notification="always"/>
</groups>
</email>
</cb:define>
and included it where needed...
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<cb:include href="C:\email.config" />
<project name="MyProject" queue="Build" queuePriority="1" >
<cb:email-template >
</cb:email-template>
</project>
<project name="MyProject2" queue="Build" queuePriority="1" >
<cb:email-template >
</cb:email-template>
</project>
</cruisecontrol>
Here's what we've found so far. Of course it's not 'best practice' but it's a start:
Signing an XBAP project which requires full trust.
PFX is working fine once I figured out how to solve the issue with the CI server running as a service.
Publishing an XBAP project into an ASP.NET web application.
2.1 Should this be automated on "Release" configuration builds?
2.2 Should the published output go into the Bin directory?
2.3 Should we avoid .deploy file extensions and reuse existing assemblies if possible?
Copying to Bin caused problems with the RequestFilteringModule in IIS7 so we didn't use it.
Instead of publishing, in the AfterBuild target we copy the output into a directory in our ASP.NET web app, which is ignored by Subversion, but not by the web deploy or wix project.
So we copy what we need (dll,exe,manifest,xbap) and then use some MSBuild magic to rename to .deploy extensions, because some clients might block .exe or .dll downloads:
<Target Name="AfterBuild">
<CallTarget Targets="CopyOutputToDeployWebDir" />
</Target>
<Target Name="CopyOutputToDeployWebDir">
<CreateProperty Value="..\Path\To\Application\Dir">
<Output TaskParameter="Value" PropertyName="DeployWebDir" />
</CreateProperty>
<RemoveDir Directories="$(DeployWebDir)" />
<MakeDir Directories="$(DeployWebDir)" />
<ItemGroup>
<DeployWebFiles Include="$(OutputPath)*.dll;$(OutputPath)*.exe;$(OutputPath)*.manifest;$(OutputPath)*.xbap" />
</ItemGroup>
<Copy SourceFiles="@(DeployWebFiles)" DestinationFolder="$(DeployWebDir)" />
<ItemGroup>
<RenameFiles Include="$(DeployWebDir)*.dll;$(DeployWebDir)*.exe" />
</ItemGroup>
<Move SourceFiles="@(RenameFiles)" DestinationFiles="%(RenameFiles.FullPath).deploy" />
</Target>
Deploying XBAP requiring full trust for use from an ASP.NET web application.
At the moment it looks like we need to install signed key in both the Trusted Root Certificate Store and Trusted Publishers Certificate Store.
Versioning XBAP project.
We want the same XBAP application version as our ASP.NET web application version (in our case, AssemblyFileVersion attribute), so we ended by-passing the normal ApplicationVersion property approach, overwriting it from our shared AssemblyInfo file which is used by all assemblies in the product:
<!-- Note that this value is overridden in BeforeBuild target -->
<ApplicationVersion>0.0.0.0</ApplicationVersion>
<!-- ... -->
<Target Name="BeforeBuild">
<CallTarget Targets="SetApplicationVersion" />
</Target>
<!-- Always set application version to product version -->
<Target Name="SetApplicationVersion">
<UpdateVersion Attribute="AssemblyFileVersion" AssemblyInfo="..\ProductAssemblyInfo.cs">
<Output PropertyName="ApplicationVersion" TaskParameter="Version" />
</UpdateVersion>
</Target>
UpdateVersion is a custom MSBuild task that can read or write version attribute values in an AssemblyInfo file. It's not hard to write or find something on the web to do a similar thing.
Best Answer
Are Integration Properties like
CCNetLabel
available inside CCNET configuration? I venture to doubt that. Up to CCNET 1.4.4 SP1 they weren't. So please check theattachment
node in Your project configuration to see ifCCNetLabel
has been resolved properly.You need to define preprocessor constants that can replace the integration properties like this:
You need to instruct your compiler to write the results to a file whose name is predictable by CCNET configuration. Since configuration has no access to the label it must not be part of the filename. If you want to keep the result files from being overwritten by each build, add an executable task that triggers a simple batch file whose purpose is to copy
%ccnetartifactdirectory%\keil.txt
to%ccnetartifactdirectory%\keil_%ccnetlabel%.txt
.Otherwise the answer to this question might help here as well.