Learn about the capabilities of Visual Studio Online Services:
– how you can setup continuous builds whenever a change is committed to the source repository
– how to setup scheduled builds and deploys
– how to target deployments for your dev, test, uat and prod environments
– how to manage release security and use approval workflows
Also learn how you can use Office Dev PnP PowerShell to support rapid and automated deployments and about other alternatives out there
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Release Management with Visual Studio Team Services and Office Dev PnP
1.
2. Release Management with Visual Studio
Team Services and Office Dev PnP
Petter Skodvin-Hvammen
Principal Consultant, Puzzlepart, Norway
@pettersh | skodvinhvammen.wordpress.com | pettersh@puzzlepart.com
3. Session Goals
1. Introduction to Release Management
2. How does it work in Visual Studio Team Services
3. Introduction to Office Dev PnP
4. How can we release to SharePoint (and other)
There will be plenty of examples and demos...
4. 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.
5. Why Release Management?
• You spend to much time on planning and deploying
changes
• There are too many manual steps
risk 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
7. 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
8. Where to Deploy?
• Environments
• Environment Templates
• Approvals and approvers
• Environment Variables
• Deployment Triggers
• Queueing Policies
12. Office 365 Developer
PnP Core Component
https://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
14. Office 365 Developer
PnP PowerShell Component
https://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
16. Build and Release
using Office Dev PnP
1. Code in VSTS Git, continuous build/deploy, hosted agent, PnP-Sites-Core
2. Code in GitHub, no build, scheduled deploy, hosted agent, PnP-PowerShell
3. Code in BitBucket, nightly build/deploy, agent in Azure, PnP-PowerShell
17. 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
18. 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
19. 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
20. 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
21. Summary
• Visual Studio Team Services
• Build and Release Management
• Office Development Patterns & Practices (PnP)
42. Scenario: No Build, Scheduled Deploy using PnP-PowerShell
Code in GitHub, Hosted build agent
43.
44.
45.
46.
47. Scenario: Scheduled Build and Deploy using PnP-PowerShell
Code in BitBucket, Build agent in Azure VM
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61. 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
62. PnP-PowerShell on your
own build agent
Setup 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 GitHub
https://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