A Build Definition provides all the configuration values required  by a Build Template. A Build Template defines the workflow that will be run when a Build runs. To create a Dynamics CRM 2013 Build, you will need to use the Dynamics CRM 2013 custom template you have configured in the previous post.

All the build definitions that I will demo here are using a sample Dynamics CRM 2013 Visual Studio Solution containing the typical components you will have a Dynamics CRM deployment such as Plug-ins, Custom Workflow Activities, Web Resources and Customizations. I have create my sample project using the CRM Developer Toolkit, but this is not a pre-requisite.

Below is a screen shot of my Sample Solution:

image

 

 

So let’s get started and create a base Dynamics CRM 2013 Build that we will extend the following posts.

  1. Go to Team Explorer and Select “Builds”
    image
  2. Click on “New Build Definition”
    image
  3. Enter your build name. This should take into consideration the CRM Solution name, the source control branch, the build type and any other criteria you want to include.
    image
  4. Select the trigger. I suggest you start with a Manual trigger until your build is working as expected, you can then change it to run on check-in or scheduled basis.
    image
  5. Select the source. This would be the folder containing the visual studio solution that contains the projects for your plug-ins etc…
    image
  6. You will need to add another entry for the xRM CI Framework Folder.
    image

    image
  7. Now you should have the files you need to run a Build. You should see something like the below. During the build TFS will download these files to the Build Server.
    image
  8. Select your Build Controller and define where TFS will drop the outputs for your Build.
    image
  9. Select the Build Process Template that your builds will use. By Default TFS will display the “Default Template”. As you can see this does not contain any Dynamics CRM specific configuration.
    So click on “New” and “Browse” to the “DynamicsCRM2013ReleaseTfvcTemplate.12.xaml” that you checked-in to source control in the previous post.
    image

    image

    image
  10. Now you should be able to see lots of new sections relating to Dynamics CRM.
    image

    image
  11. Before we start using the Dynamics CRM features, we need to configure some basic builds settings.
    Select the solutions you need to build/compile and the configurations you need to use.
    image
  12. If you have written any automated tests. This where can specify whether these should run after the build.
    image
  13. You might need to select the “Tags” for the Agent that you want your Build Controller to use.
    image
  14. If you want your CRM Solution version to be inline with your TFS Build number, You will need to change the format to something that is compatible with the CRM Solution version numbers. The template will take everything after the “_” when updating the CRM Solution version.
    image
  15. You need set “Copy Outputs to Drop Folder” if you want the TFS Build to copy the outputs (binaries, CRM Solutions, etc…) to the output folder specified.
    image
  16. Finally let the template know the location of the xRM CI Framework PowerShell extensions that you checked-in to TFS.
    image
  17. Don’t forget to setup your retention policies.These can same you space and ensure you keep the builds that you need.
    image
  18. I will cover the remaining CRM sections in the next posts. But it is important we ensure our Build works at this stage. So save the definition. You should see it appearing in your Builds now. So let’s queue one of them and see what will happen.
    image

    image
  19. The build should finish shortly.
    image
  20. Click on “Open Drop Folder”. You should be able to see the output of your Build.
    image

    image
  21. Check out the following posts to see how you can extend this definition to allow your to Build & Deploy CRM Solutions and Packages.

Last edited Aug 19, 2014 at 7:21 PM by waelhamze, version 7