Download presentation
Presentation is loading. Please wait.
Published byMervin Adams Modified over 9 years ago
1
Automated Deployment Framework Using TFS and Custom PowerShell cmdlets to create an automated deployment framework
2
Agenda TFS Build/Deploy Extending TFS Build/Deploy Custom PowerShell Cmdlets Putting it all Together
3
TFS Build/Deploy How it works – Workflow Activities – XAML – Build Definitions – Build Controllers/Agents
4
TFS Build/Deploy Default Process – Trigger – Local Workspace/Drop Folder – Build – Test – MSBuild
5
TFS Build/Deploy Restrictions – Build Packages – Deploy only through the msbuild command – Rebuilds projects/solution every time
6
Extending TFS Build/Deploy The Templates – XAML (Silverlight was actually worth something!) – Workflow Activities – Custom Activities and Editors Build Controller Assemblies – Start with the default template and add/remove as needed Test Frequently!
7
Extending TFS Build/Deploy PowerShell – Object based – Snapins/modules for about every MS product – Remote server commands getting rolled into many cmdlets – Excellent community support
8
Extending TFS Build/Deploy PowerShell The EEEvil Stuff – Getting rolled into products by separate product teams Error Handling Escaping rEtrieve Behavior
9
Extending TFS Build/Deploy WebDeploy – Package deployment – SetParameter Files – Remote Execution of Scripts – Azure and Lab Deployments
10
Extending TFS Build/Deploy Setting it up – Update the template to run a PowerShell script (copy scripts locally and execute it) – Setup a PowerShell script to do your deployment by executing a WebDeploy command line – Setup your build definitions
11
Extending TFS Build/Deploy Drawbacks to the straight PowerShell approach – Whomever creates/maintains the deployments must know the ins and outs of PowerShell and each PowerShell module you use (iis, adfs, SQL, server, etc) – With multiple deployments, you end up with a lot of duplication between scripts – Complex deployments result in complex scripts
12
Custom PowerShell Cmdlets Expose.NET code through PowerShell – System.Management.Automation – Inherit from Cmdlet and override BeginProcessing and ProcessRecord methods – Provide help/examples through an xml file – Create a cmdlet for each type of deployment you support and for any common deployment tasks – Can pass in parameters, a file path, use a database, etc for deployment info depending on the complexity of the deployment
13
Custom PowerShell Cmdlets Install the custom cmdlets on each TFS build agent (using PowerShell of course) Update the PowerShell deployment scripts to call your custom cmdlets
14
Resources Customizing TFS Templates – http://www.ewaldhofman.nl/post/2010/04/20/Customize-Team-Build-2010-e28093-Part-1- Introduction.aspx TFS/ALM – http://www.deliveron.com/blog/author/mikedouglas.aspx Web Deploy – http://blogs.iis.net/harshmittal/archive/2012/07/26/announcing-web-deploy-3-0-rtw.aspx PowerShell – http://technet.microsoft.com/en-us/library/bb978526.aspx Custom PowerShell Cmdlets – http://blogs.charteris.com/blogs/ivorb/archive/2011/11/01/create-a-custom-powershell- cmdlet-end-to-end.aspx Andy Bayer Deliveron Consulting Services andybayer@deliveron.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.