Wednesday, 5 November 2014

BizTalk and Continuous Integration


I really enjoy having all my BizTalk code built, deployed and packaged nightly. It strengthens the code and configuration immeasurably. It also limits the little suprises come deployment time and every morning I have fresh msi's available to me, my team and operations.

With the use of a BizTalk build server, a continuous integration tool, Atlassian's Bamboo is my favourite, MSBuild ExtensionPack and some MSBuild scripts, I can easily achieve this... and more.


Create a Bamboo plan that executes an MSBuild Task





Set up some plan variables



Then schedule the plan to run at night


Point the Bamboo task at a MsBuild file like the following:


<Target Name="NightlyBuild">

<!-- Get latest code base -->
<MSBuild.ExtensionPack.VisualStudio.TfsSource TaskAction="Get" ItemPath="$(TeamProject)" Force="true" />

<!-- Compile Solution -->
<Exec Command ="devenv $(ApplicationName).sln /Rebuild $(BuildType)" />
    
<!-- Create application -->
<Exec Command ='"BTSTask" AddApp /ApplicationName:$(ApplicationName)"' />

<!-- Add Biztalk assembly -->
<Exec Command ='"BTSTask" AddResource /Type:System.BizTalk:BizTalkAssembly  /Source:$(ApplicationName).Schemas.dll 
 /Options:GacOnAdd,GacOnInstall,GacOnImport /Overwrite /ApplicationName:$(ApplicationName)'  />

<!--Generate and add binding files-->
<MSBuild Projects="MSBuildBinding.xml" Targets="Generate;AddToApplication" />
    
<!--Export msi--> 
<Exec Command ='"BTSTask" ExportApp  /ApplicationName:$(ApplicationName) /Package:$(ApplicationName).msi' />
    
</Target>


This is just a small taste of what you can achieve with Bamboo and MSBuild.


1 comment:

  1. Great Article, I am planning to use Bamboo as a CI/CD tool, do you have more articles or documentation like this which could help me to setup similiar to this.

    ReplyDelete