In this post I will show you how to create a Build Definition to Import the CRM Solution we generated in the previous Builds. This will allow you to deploy your CRM Solution into other environments during the build.

Two of the most common scenarios for this would be:

  1. Deploy the most recent changes to your main development Org from source control
  2. Deploy the most recent changes to another stage or test org

In both of the above cases you could also consider to run a series of tests post deployment to ensure everything is working as expected.

During the solution import, the process template will go through several optional stages in the order below. These are in addition to the steps covered in the “SampleBase” build definition.

  1. Import CRM Solution
  2. Publish Customizations

To be able to use the import features, your build definition needs to extend one of the build definition that I covered in the previous post that generate the solutions to be imported. You can either enhance or clone your “SamplePack” or “SampleExport” build following the steps in the previous post. In this case I will be cloning the “SamplePack” build definition. 

Steps…

  1. Enter name for your Build Definition
    image
  2. Most of the configuration was already provided in the “SamplePack” build definition so we just need to fill the below.
    image
  3. Enter the connection string to the target CRM Org where you want to import your CRM Solution
    image

    image

    image
  4. Set the below to True otherwise the import process will be skipped.
    image
  5. Select which Solution Type you want to import. Make sure you have specified to generate this type in the previous sections.
    image
  6. Setting this to True will publish all the customizations after the import. Can be useful if you are using Unmanaged solutions.
    image
  7. Finally specify any additional import settings based on your requirements.
    image
  8. Go ahead save this build definition and queue a new Build.
    image
  9. If everything goes well, your Build should succeed.
    image
  10. Click on Open Drop Folder to check the outputs. You will see the two Solution files we packed with the same version as the Build.
    image
  11. If you go in your target Org, you should see the latest solution version imported.
    image
  12. If you check the logs folder inside the drop location, you will see an xml log file for the import. This is the same file that you can download from CRM after you import your solution manually from the UI. This can be useful in case you have errors during the import. You can open this file in Excel as usual to see the details.
    image

    image
  13. Finally if you check the diagnostics logs of the Build you should be able to see the details of the import execution.
    image
  14. Now you should have a build definition that allows you to not only Build your CRM Solution but also Import this Solution into a Target Environment. If you need to import more than one Solution or Deploy other components, consider extending the build definition or take a look at CRM Deployment Package in this post.

Last edited Aug 5, 2014 at 7:35 PM by waelhamze, version 5