2. Thibaud Gravrand
• .Net Developer for 7 years
• R&D Manager for Netsize, a Gemalto Company
• http://fr.linkedin.com/in/tgravrand
• https://twitter.com/dolomitt
3. How did we deploy before ?
• Let’s go for a simple xcopy – why should I need more than that ?
• Some zips here and there
• Attempt of deployment from CI ?
4. But there are inconvenients
• I think my script will not work in production but let’s try !
• When did we release the last version ?
• I think we did not deliver the same version…
• I forgot one dll, I’ll just add it quickly without being noticed
5. Let’s write down how we like our
deployments
• Should be a repeatable process
• Should be fully automated
• Should support strong versioning
• Should tackle complex distributed deployments
• Should not forget what we did, who did it and when
• Should take care of development and production environments
• Should allow responsabilities split between teams
• Should be fast !!
6. Octopus Deploy
• Developed by Paul Stovell since 2011
• Dedicated solution for Windows Platforms
• Heavily relies on nuget package software
11. Step 2 - Create Package of your application
• Simply add OctoPack Nuget Package to your projects
• Publish Package to Nuget Repository
• Either built-in or external Nuget Repo
• Typically pushed from TeamCity, Jenkins and other CI
• Supported types of projects
• Web Application
• Windows Service
• Windows Executable
12. Step 3 – Create Project in Octopus Deploy
• Describe your project quickly
• Define Versioning Policy
• Arbitrary & Incremental
• From Main Nuget Package Version
• Define Deployment Policy
• Copy missing or all packages to tentacles
13. Step 4 – Create Deployment Process
• Describe each step of deployment for your application / solution
• Heavily relies on Powershell 2.0
• Steps can be :
• Setup IIS Site
• Run executable
• Run Powershell Script
• Customize Configuration
• Approval Flow (Email)
• Steps can be run in parallel
14. Step 5 – Define Variables
• Describe variables for each environment
• Variables are associated to scopes and will be evaluated at deployment
time
• Configuration Files will be transformed according to variable values
• Scopes can be linked to :
• Environment
• Machine
• Step number
15. Example of Variable Definitions
Variable Value Scope
DatabaseServer dev028db DEV
DatabaseServer qa028db QA
DatabaseServer Prod028db1 PROD;Machine1
DatabaseServer Prod028db2 PROD;Machine2
DNS dev.octopus.com DEV
DNS qa.octopus.com QA
DNS www1.octopus.com PROD;Machine1
DNS www2.octopus.com PROD;Machine2
16. Step 6 – Create Release
• Creating a release will make a snapshot of :
• Variables
• Steps
• Powershell Scripts
• Package References
• Release can be based on several nupkg files
18. Step 7 – Deploy Release
• Choose a release
• Choose an environment
• Deploy !
• Each step is being executed sequentially
• Configuration Files are being transformed
• Web.Config Transform Feature similar to Visual Studio
• Key Value Replacement
23. Flavor of Continuous Delivery
Build Run Unit Tests Deploy to DEV
Run Sanity
Check
Promote to
INT
Run Full
Integration
Tests
Promote to QA
Run Manual
Tests
Promote to
PROD
24. Some drawbacks
• Manual Rollbacks
• One instance of a project on a tentacle client
• Packages limited to 10 megabytes
• Might be difficult to handle exotic configuration files
25. Features - Last but not least
• Full Audit Log
• Strong REST API
• Nuget Repository
• Retention Policies
• Permission Model
• Lifecycle Management
• Azure Deployments
• Scheduled Deployments
26. Advanced Scenarios
• Let’s talk to Nagios or OP/5 to tell them I’m updating some services
• Let’s deploy in PCI-DSS environments
27. Roadmap
• Linux Deployments through SSH
• Remote Delta Compression
• Offline Deployment
• Replace RavenDB with SQL Server
28. Resources
• https://demo.octopusdeploy.com/app
• DotNetRocks, episode 1002: Interview with Paul about Octopus
Deploy.
• DotNetRocks, episode 966: Nick discusses structured logging, with an
overview of Octopus at the start.
• Herding Code, episode 143: Paul Stack discusses continuous
integration, and mentions Octopus at 20:23. Scott talks about his
experiences with Octopus.
Chosen Solution for Deploying web applications for nuget.org
Publication can be done with nuget or octo.exe
Strong usage of Nuget Packaging and Strong Versioning (SemVer style)
Additionnal tasks in csproj – msbuild will take care of executing tasks
Octopus built-in repository will refuse already existing versions of packages
Variables can be sensitive. Permissions can discriminate accesses to variable values
Create release can be automated when new package is pushed to built-in repository
Rolling Deployment – Sequential deployment – X machines at a time
Canary Deployment – Deploy to one and test then deploy to remaining
Blue-green Deployment – Deploy alternatively for minimum downtime
Isolated – PCI – Split pre-prod and prod