Release Strategy for Dynamics CRM - Part 2 - Setting Up the Build

This is the second of a three part series in which I walk through setting up a release management strategy for Dynamics CRM.

In first part of the series accomplished the following:

  1. Setup the project structure using the nullfactory-xrm yeoman generator.
  2. Download the CRM solution from the remote server and unpacked it using the solution packager tool.
  3. Checked-in all the artifacts back into Visual Studio Team Services (VSTS) source control.

In this post I describe the steps required for setting up a team build. One of the goals with the generated project structure was to have it work with team builds with the least amount configuration.

Setting Up the Team Build

  1. Navigate to the Build and Release > Builds from within the VSTS team project.

    Build and Release Menue

  2. Create a new build definition using a vanilla Visual Studio template.

    Visual Studio Template

  1. If you want to use the artifact from this build as part a release deployment, then we need to explicitly copy the deploy scripts into the artifact staging folder. Let's do this by clicking on the Add Task and selecting Copy Files task and licking the add button.

    Copy Task

    This explicit copy is required because the Nullfactory.Xrm.Tooling is not designated to build as part of the solution.

  2. Next let's configure the task with the following parameters:

    • Source Folder - $(build.sourcesdirectory)
    • Contents - **/Deploy-*.ps1
    • Target Folder - $(build.artifactstagingdirectory)
    • Change the name of the task into something more meaningful - Copy Deploy Scripts to: $(build.artifactstagingdirectory)

    Copy Task

  3. Make sure that the newly added task is set to execute before the Publish Artifact: drop task.

  4. Save and provide the new build a name.

    Build Name

  5. Now let's test it out by queuing a new build.

  6. Once the build is complete, navigate to the artifacts and explore the drop folder to verify that all the required file have been copied .

    Build Artifacts

Congratulations! Now you have team build that builds and packages the Dynamics CRM solution. Go forth and extend the definitions to suit your particular development workflow.

In the next post I will show you how to setup a release management definition and automate deployment to Dynamics CRM environments.

comments powered by Disqus