getting started with octopus deploy
TRANSCRIPT
“Our mission is to help .NET developers deliver software to production successfully.” – Octopus Deploy
Schedule
• Module 1: The Octopus Deploy Server
• Module 2: The Octopus Deploy Tentacles
• Module 3: Projects and packages
• Module 4: The deployment process
• Module 5: Advanced topics
How?
• Discussions
• Theory
• Exercises
Discussion:Manual vs Automatic
deployments
Module 1: The Octopus Deploy Server
Screenshot from demo site: https://demo.octopusdeploy.com/
The Octopus Web Portal
Environments
Screenshot from demo site: https://demo.octopusdeploy.com/app#/environments
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 1: Installing the Octopus Deploy Server
• Exercise 2: Setting up your environments
Module 2: Octopus Deploy Tenacles
Tentacles
Tentacle
Octopus Deploy Server
Tentacle
Tentacle
Tentacle
Tentacle
Tentacle
Azure WebsiteServer with FTP
access only
Tentacle modes
• Listening (recommended)• Listens to TCP port
• Polling• Polls the Octopus Server periodically
Machines
Screenshot from demo site: https://demo.octopusdeploy.com/app#/environments
Machine roles
Screenshot from demo site: https://demo.octopusdeploy.com/app#/projects/octofx-rate-service/process
Example
Test
Production
Test server
Prod server 1 Prod server 2
Applications:
Web Forms Application(runs on test server + 1 production server)
ASP.NET MVC Application(runs on test server + both production servers)
Example
Test
Production
Test server
Prod server 1 Prod server 2
Applications:
Web Forms Application(runs on test server + 1 production server)
Role: forms-server
ASP.NET MVC Application(runs on test server + both production servers)
Role: web-server
Example
Test
Production
Test serverforms-server & web-
server
Prod server 1forms-server & web-
server
Prod server 2web-server
Applications:
Web Forms Application(runs on test server + 1 production server)
Role: forms-server
ASP.NET MVC Application(runs on test server + both production servers)
Role: web-server
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 3: Installing an Octopus Deploy Tentacle
• Exercise 4: Add a machine to the test environment
Module 3: Projects and Packages
Projects
Screenshot from demo site: https://demo.octopusdeploy.com/app#/projects
Project groups
Screenshot from demo site: https://demo.octopusdeploy.com/app#/projects
Packages
• NuGet packages
• Feeds• Built-in Octopus feed• External feed
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 5: Creating a project
• Exercise 6: Uploading a package
Module 4: The deployment process
Deployment process
Screenshot from demo site: https://demo.octopusdeploy.com/app#/projects/octofx-trading-website/process
Step types
• Deploy a NuGet package• Run a PowerShell script• Send an email• Manual intervention required• Deploy to Windows Azure• Upload files by FTP• ... and you can create your own
Sequential vs parallel
• Sequential• Step A finishes before step B can begin• Default
• Parallel• Step A and step B can run at the same time
Rolling deployments
• Run all steps on machine A before running them on machine B
• Child steps
Typical deployment process
• 1. Deploy web rolling• 1.1. Remove server from load balancer• 1.2. Deploy web application • 1.3. Warmup web application• 1.4. Add server back to load balancer
• 2. Email release notes to product owner
Releases
Screenshot from demo site: https://demo.octopusdeploy.com/app#/projects/octofx-trading-website/releases/2.9.3102
Variables
Screenshot from demo site: https://demo.octopusdeploy.com/app#/library/variables/LibraryVariableSets-1
Variable
• Name• Value• Scope• Environments• Machines• Roles
#{VariableName}
Example
• Load balanced application in production, only one server should index content.
Example
• Load balanced application in production, only one server should index content.
Name Value Scope
RunIndexer false Production
RunIndexer true Production; Machine A
System variables
http://docs.octopusdeploy.com/display/OD/System+variables
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 7: Defining your deployment process
Module 5: Advanced topics
Lifecycles
Step templates
Script modules
Library variable sets
Lifecycles
Screenshot from demo site: https://demo.octopusdeploy.com/app#/library/lifecycles/lifecycle-ProjectGroups-1
Lifecycles allow you to...
• ...control the order of deployment from one environment to the next
• ...automatically deploy to an environment when a release is created.
• ...define the number of releases to keep for each phase of the lifecycle.
Controlling the order of deployment
Example: A project should be deployed to either Development or Test before it's deployed to Production.
• Phase 1: Deploy to either Development or Test• Minimum environments before promotion: 1
• Phase 2: Deploy to Production
Automatically deploy to an environmentExample: A release will automatically be deployed to Development when the release is created
• Phase 1: Deploy to either Development or Test• Automatically deploy to: Development• Allow manual deployment to: Test• Minimum environments before promotion: 1
• Phase 2: Deploy to Production• Allow manual deployment to: Production
Define the number of releases to keep
Retention policies• Number of releases to keep• Number of days to keep a release
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 8: Configuring a lifecycle
Step templates
Screenshot from demo site: https://demo.octopusdeploy.com/app#/library/steps/ActionTemplates-1
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 9: Create a step template
Script modules
Screenshot from demo site: https://demo.octopusdeploy.com/app#/library/scripts/LibraryVariableSets-33
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 10: Create a script module
Library variable sets
Screenshot from demo site: https://demo.octopusdeploy.com/app#/library/variables/LibraryVariableSets-1
Lab
http://octopusdeploylab.azurewebsites.net/
• Exercise 11: Create a variable set