Release Management with Visual Studio Team Services and Office Dev PnP
Petter Skodvin-HvammenPrincipal Consultant, Puzzlepart, Norway
@pettersh | skodvinhvammen.wordpress.com | [email protected]
Session Goals
1. Introduction to Release Management2. How does it work in Visual Studio Team Services3. Introduction to Office Dev PnP4. How can we release to SharePoint (and other)
There will be plenty of examples and demos...
What is Release Management?
“Release management is the process of managing, planning, scheduling and controlling a software build through different stages and environments; including testing and deploying software releases”
https://en.wikipedia.org/wiki/Release_management
In Visual Studio Team Services Service that helps you automate the deployment and testing of your software in multiple environments.
Why Release Management?
• You spend to much time on planning and deploying changes
• There are too many manual stepsrisk of failure
• It is not clear what feature or fix is released to which environment
• One-click deploy to all of your environments on-demand
• Schedule deployments• Automatically deploy when
code changes• Roll back to previous version
easily• Control who can release to
each environment• Track the releases across
environments
Release Definitions
Specifications of
• What to deploy? Artefacts• Where to deploy?
Environments• How to deploy? Tasks
What to Deploy?
• Build server outputs:• Team Services (VSTS)• Team Foundation Server
(TFS)• Jenkins• TeamCity
• Version control sources:• TFVC, Git and GitHub
• Other sources:• NuGet• PowerShell• Cmd and Shell
Where to Deploy?
• Environments• Environment Templates• Approvals and approvers• Environment Variables• Deployment Triggers• Queueing Policies
How to Deploy?https://www.visualstudio.com/en-us/docs/build/define/build
Custom build tasks/extensions
https://www.visualstudio.com/en-us/docs/integrate/extensions/develop/add-build-task
http://blog.devmatter.com/custom-build-tasks-in-vso
DEMO
Office 365 Dev Patterns & Practices (PnP)https://github.com/OfficeDev/PnP-Sites-Core https://github.com/OfficeDev/PnP-PowerShell https://github.com/OfficeDev?query=office-ui-fabric (http://dev.office.com/fabric)
Office 365 Developer PnP Core Componenthttps://github.com/OfficeDev/PnP-Sites-Core
• .NET library aimed to ease working with CSOM/REST api• If you prefer Configuration as Code (using C#)• Available as NuGet package
Configuration as Code
Office 365 Developer PnP PowerShell Componenthttps://github.com/OfficeDev/PnP-PowerShell
• PowerShell commands for working with SharePoint Online and On-Premises
• If you prefer Configuration by Declaration (using XML/JSON)• Available from the PowerShell gallery using the PowerShellGet module
Declarative Configuration
Build and Release using Office Dev PnP 1. Code in VSTS Git, continuous build/deploy, hosted agent, PnP-Sites-Core2. Code in GitHub, no build, scheduled deploy, hosted agent, PnP-PowerShell3. Code in BitBucket, nightly build/deploy, agent in Azure, PnP-PowerShell
DEMO
Scenario 1
• Code in https://pettersh.visualstudio.com/espc16• Continuous builds (on commit)• Continuous deploy (on successful build)• Cloud hosted VSTS agent• Provisioning using PnP-Sites-Core
DEMO
Scenario 2
• Code in https://github.com/pskodvin/espc16-github • No builds (no triggers defined)• Scheduled deploy• Cloud hosted VSTS agent• Provisioning using PnP-PowerShell
DEMO
Scenario 3
• Code in https://bitbucket.org/puzzlepart/hoegh-o365-intranet
• Scheduled builds• Continuous deploy (on successful build)• Azure hosted VSTS agent• Provisioning using PnP-PowerShell
Relevant Topics
Some related thoughts and ideas worth considering
• Automatically create labels, tags or branches• Automatically relase when a pull request is accepted and successfully
built• Automatically provision or decommission virtual machines using ARM• Automatically create news, blog posts, SharePoint items, Yammer
posts,…• Deploy to
• SharePoint on-premises• Azure web jobs• Provider hosted apps• Microsoft graph
Summary
• Visual Studio Team Services• Build and Release Management• Office Development Patterns & Practices (PnP)
puzzlepart.com
Twitter: @pettershBlog: skodvinhvammen.wordpress.comEmail: [email protected]
Backup slidesIn case of connectivity issues (oh nooooo….)
Scenario: Continuous Build and Deploy using PnP CoreCode in VSTS Git, Hosted agent
Scenario: No Build, Scheduled Deploy using PnP-PowerShellCode in GitHub, Hosted build agent
Scenario: Scheduled Build and Deploy using PnP-PowerShellCode in BitBucket, Build agent in Azure VM
PnP-PowerShell on a hosted build agent• Windows Server 2012 R2, 64-bit, with Windows PowerShell 4.0• PnP-PowerShell is NOT installed!• How to install PnP-PowerShell?
• Install-Module (requires PowerShell 5.0/5.1)• Installer MSI from
https://github.com/OfficeDev/PnP-PowerShell/releases • Clone https://github.com/OfficeDev/PnP-PowerShell.git or
download zip
PnP-PowerShell on your own build agentSetup as a Virtual Machine in Azure• Windows Server 2012 R2, 64-bit, with Windows PowerShell 4.0• Install PnP-PowerShell from PowerShell Gallery or using MSI from
GitHubhttps://github.com/OfficeDev/PnP-PowerShell/releases
• Install other requirements like Node.js, NPM, Typings, Gulp, etc….• Install
https://github.com/Microsoft/vsts-agent/releases/download/v2.108.0/vsts-agent-win7-x64-2.108.0.zip