Want to add your own post deploy functionality to a Sitecore deployment or Sitecore update package? There’s a feature for that!
Post deployment steps in Team Development for Sitecore was built to easily allow developers to add their own functionality to the Sitecore deployment process. Adding custom post deploy steps was a hugely requested feature, and it's easy to see why. Adding post deploy steps to your Sitecore deployment architecture can perform a number of useful functions, like triggering a save event for every deployed item or having deployed items published automatically.
Writing these steps requires you to understand how to write MSBuild scripts. Fortunately, there are many resources available on the web. The MSBuild Reference is a good place to start. If you want to quickly review the built-in MSBuild tasks, please see the MSBuild Task Reference.
Once you have a firm grasp of MS Build scripts comes the real tricky part, applying it to life. During the course of your day think of all the little parts of your solution that would be nice to automate or cool actions that would be nice too. Once you think up a few, it's downhill from there!
To create a Custom Step, you first need to create a post deployment class, the class needs to inherit from the IPostDeployAction interface. This interface is located in the TDS Assembly. After creating the post deployment class, add it to the project so it can be included in the build (either by including the class in another assembly that is being deployed, or ensuring that the assembly is copied to the /bin folder of the Source Web Project referenced in the TDS General property page). Finally, once the fully qualified class has been added to the .scproj file, the developer can manipulate the class in the deploy property page.
@seanholmesby created a custom script to rebuild the Content Search Indexes after deployment
@jammykam created a custom script to run post-deploy actions and add additional post deploy steps whenever needed using PowerShell scripts.
@AgileStCyr created a custom script that removes files; give it a pipe-delimited list of relative paths that are in the web root that you want gone and it will look for them and clean them out!
@dthunziker created a custom script that takes the mystery out of Update Package installations by notifying a Slack channel after the installation completes.