SlideShare a Scribd company logo
03.06.2014 / 1
AUTOMATED RELEASE
MANAGEMENT
WITH TEAMCITY & OCTOPUSDEPLOY
CONTINOUS DELIVERY
03.06.2014 / 3
Continuous Integration
03.06.2014 / 4
Continuous Deployment
03.06.2014 / 5
Continuous Delivery
03.06.2014 / 6
It’s all about frequent releases
03.06.2014 / 7
John Allspaw: “Ops metametrics” http://slidesha.re/dsSZIr
It’s all about failing fast
It’s all about expanding your horizon
Developer responsibility horizon
•Dude, it compiles!
•It works on my machine
•All tests pass
•QA approved it
•It’s working in production
“We don’t know, man, we just don’t know.” The confident Nick of months
prior shook now, leading Fred to his cubicle. “We coded the application. We
debugged until it compiled without errors. When we run it- core dump!” He
threw up his hands, then dropped into his swivel chair. “We’ve been
pestering IBM support, but they haven’t been very helpful.”
“Well, why would they be?” Fred frowned, pausing at the cube threshold. “I
mean, who knows what might be wrong with the code?”
“Nothing’s wrong with it. It compiles!”
“So? It could still have errors.”
Nick swiveled around to face him. “Dude. It compiles.”
«Nothing at facebook is anyone elses problem»
- Kent Beck (Is TDD dead –part 3)
The deployment pipeline
03.06.2014 / 11
Test coverage
03.06.2014 / 12
http://www.industrieit.com/blog/2012/02/a-practical-guide-to-extending-continuous-integration-to-continuous-delivery/
http://jamescrisp.org/2011/05/30/automated-testing-and-the-test-pyramid/
Blue-green deployment
03.06.2014 / 13
Jez Humble: “Continous Delivery” http://www.slideshare.net/jezhumble/continuous-delivery-5359386
Blue-green deployment
03.06.2014 / 14
Jez Humble: “Continous Delivery” http://www.slideshare.net/jezhumble/continuous-delivery-5359386
Blue-green deployment
03.06.2014 / 15
Jez Humble: “Continous Delivery” http://www.slideshare.net/jezhumble/continuous-delivery-5359386
Blue-green deployment
03.06.2014 / 16
Jez Humble: “Continous Delivery” http://www.slideshare.net/jezhumble/continuous-delivery-5359386
Canary releasing
03.06.2014 / 17
Jez Humble: “Four principles or Low-Risk Software releases” http://www.informit.com/articles/article.aspx?p=1833567
The arguments
03.06.2014 / 18
The arguments
03.06.2014 / 19
• Before: ~30 minutes
• After: 4 minutes
• 4 times per day
• Time spent: 8 hours
• Days until investment time paid:
8 ÷ 0.43 ÷ 4 = 4.65 ≈ 𝑗𝑢𝑠𝑡 𝑎𝑓𝑡𝑒𝑟 𝑙𝑢𝑛𝑐ℎ
03.06.2014 / 20
DEPLOYING A WEBSITE
03.06.2014 / 21
Basic asp.net mvc4 website
<hgroup class="title">
<h1>Welcome to ASP.NET Web API!</h1>
<br />
<h2>
@WebApiApplication.Environment -
@WebApiApplication.Version
</h2>
</hgroup>
03.06.2014 / 22
Web.Development.config
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-
Document-Transform">
<appSettings>
<add key="Environment" value="Development“
xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</appSettings>
</configuration>
03.06.2014 / 23
Creating the Octopus NuGet package
• Why NuGet?
– Metadata
– Lots of available tools
– Feed-based
– Developers know how to use them
– Already used for other purposes (check out chocolatey.org)
• Does NOT use the default NuGet conventions
– Octopus deploys the exact structure of the package
03.06.2014 / 24
mvc4webapi.nuspec
<?xml version="1.0"?>
<package
xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Itera.NDC2013.TCOD.Web</id>
<title>ASP.NET MVC 4 Web Api demo site</title>
<version>1.0.0</version>
<authors>Kristoffer Rolf Deinoff</authors>
<owners>Kristoffer Rolf Deinoff</owners>
<licenseUrl>http://itera.no</licenseUrl>
<projectUrl>http://itera.no</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A sample project</description>
<releaseNotes>First release</releaseNotes>
</metadata>
</package>
03.06.2014 / 25
Using OctoPack
03.06.2014 / 26
Using TeamCity
03.06.2014 / 27
Using NuGet.exe
nuget.exe pack $nuspecFileName
-OutputDirectory $contentDir
-Version $version
03.06.2014 / 28
Configuring TeamCity
03.06.2014 / 29
Configuring TeamCity – Commit build
03.06.2014 / 30
Configuring TeamCity – VCS root
03.06.2014 / 31
Configuring TeamCity – Patch AssemblyInfo
03.06.2014 / 32
Configuring TeamCity - Compile
03.06.2014 / 33
Configuring TeamCity – Commit tests
03.06.2014 / 34
Configuring TeamCity – Trigger on check-in
03.06.2014 / 35
Configuring TeamCity – Build artifacts
03.06.2014 / 36
Configuring TeamCity – NuGet Server
03.06.2014 / 37
Configuring TeamCity – NuGet Server
03.06.2014 / 38
Configuring OctopusDeploy - Environments
03.06.2014 / 39
Configuring OctopusDeploy – NuGet server
03.06.2014 / 40
Configuring OctopusDeploy – Steps
03.06.2014 / 41
Configuring OctopusDeploy – Publish website
03.06.2014 / 42
Configuring OctopusDeploy – Publish website
03.06.2014 / 43
Configuring OctopusDeploy – Smoke test
03.06.2014 / 44
$url = ("http://" + $hostname + ":" + $port + "/")
Invoke-WebRequest $url -UseBasicParsing
Configuring OctopusDeploy – UAT Verification
03.06.2014 / 45
Configuring OctopusDeploy – Variables
03.06.2014 / 46
Configuring OctopusDeploy – Security
03.06.2014 / 47
Configuring OctopusDeploy – Security
03.06.2014 / 48
Configuring TeamCity – Integration build
03.06.2014 / 49
Configuring TeamCity – Dependencies
03.06.2014 / 50
Configuring TeamCity – Create release
03.06.2014 / 51
Configuring TeamCity – Integration tests
03.06.2014 / 52
$url = ("http://tcod-build:8080/")
$TeamCitySession = New-Object Microsoft.PowerShell.Commands.WebRequestSession
Invoke-WebRequest -Uri $url -WebSession $TeamCitySession -UseBasicParsing
DEPLOYING A SERVICE
03.06.2014 / 53
Asp.net mvc webapi as a service
03.06.2014 / 54
<appSettings>
<add key="Environment" value="Local" />
<add key="Hostname" value="localhost" />
<add key="Port" value="8989" />
</appSettings>
And then…
03.06.2014 / 55
Differences - Steps
03.06.2014 / 56
Differences - Publish service
03.06.2014 / 57
Differences - Variables
03.06.2014 / 58
Differences - Automated «Acceptance test»
03.06.2014 / 59
$url = ("http://tcod-build:8090/api/version")
$TeamCitySession = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$response = Invoke-WebRequest -Uri $url -WebSession $TeamCitySession -UseBasicParsing
if ($response.Content.Contains("Development")){
Write-Host "Correct environment(Development)."
}
else{
Write-Host Environment 'Development' not found.
Exit 1
}
$buildNumber = $env:build_number
if ($response.Content.Contains($buildNumber)){
Write-Host "Correct build number($buildNumber)."
}
else{
Write-Host Build number '$buildNumber' not found.
Exit 1
}
WRITING POWERSHELLS SCRIPTS
03.06.2014 / 60
Deploy.config
03.06.2014 / 61
<?xml version="1.0"?>
<configuration>
<name>MyProject</name>
<nuGet>
<url>"http://www.myget.org/F/MyProject/"</url>
<apiKey>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</apiKey>
<username>myUser</username>
<password>myPassword</password>
</nuGet>
</configuration>
CreateOctopusPackage.ps1
03.06.2014 / 62
param ([string]$contentDir, [string]$version)
try{
$configFile = New-Object XML
$configFile.Load('Deploy.config')
$config = $configFile.configuration
$nuspecFileName = $config.name+'.nuspec'
$targetNuspecFileName = Join-Path $contentDir $nuspecFileName
.nuget.exe pack $targetNuspecFileName
-OutputDirectory $contentDir
-Version $version
}
catch {
Write-Error $error[0]
Exit 1
}
PublishNuGet.ps1
03.06.2014 / 63
param ([string]$contentDir, [string]$version)
try{
$configFile = New-Object XML
$configFile.Load('Deploy.config')
$config = $configFile.configuration
$nugetFileName = $config.name+'.'+$version+'.nupkg'
nuget sources Add -Name $config.name -Source $config.nuGet.url
-Username $config.nuGet.username
-Password $config.nuGet.password
nuget push $nugetFileName $config.nuGet.apiKey -Source $config.name
nuget sources Remove -Name $config.name
}
catch {
Write-Error $error[0]
Exit 1
}
CreateMSDeployPackage.ps1
03.06.2014 / 64
param ([string]$sourceDir, [string]$targetPackage)
$BuildDir = (Split-Path $MyInvocation.MyCommand.Path -Parent)
$msdeploy = $BuildDir + "msdeploy.exe"
$parameterFile = $BuildDir + "parameters.xml"
$msdeploy_params = " -verb:sync"
$msdeploy_params += " -source:contentPath=" + $sourceDir
$msdeploy_params += " -dest:package=" + $targetPackage
$msdeploy_params += " -declareParamFile:" + $parameterFile
Write-Host "creating '$targetPackage' from '$sourceDir'."
try {
iex "$msdeploy $msdeploy_params"
}
catch {
Write-Error $error[0]
Exit 1
}
Deploy.ps1
03.06.2014 / 65
. .DeployUtil.ps1
$ServiceName = "Itera.NDC2013.TCOD.Service"
$ServiceExecutable = $ServiceName + ".exe"
Install-WebApi-Service $ServiceName $ServiceExecutable
DeployUtil.ps1
03.06.2014 / 66
function Install-WebApi-Service($name, $executable) {
Write-Host "'$name'$executable'"
$service = Get-Service $name -ErrorAction SilentlyContinue
$fullPath = Resolve-Path $executable
if (! $service) {
Write-Host "Installing service"
$frameworkDir = Get-FrameworkDirectory
Set-Alias install_util (Join-Path $frameworkDir "installutil.exe")
install_util $fullPath
} else {
Write-Host "The service will be stopped and reconfigured"
Stop-Service $name -Force
& "sc.exe" config $service.Name binPath= $fullPath start= auto
}
$config = $executable + ".config"
$port = Get-Port $config
Set-User-Rights $port "NT AUTHORITYNETWORK SERVICE"
Write-Host "Starting service"
Start-Service $name | Write-Host
}
DeployUtil.ps1
03.06.2014 / 67
function Get-FrameworkDirectory {
$([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())
}
function Set-User-Rights($port, $user) {
$uri = "http://+:$port/"
$acls = (netsh http show urlacl url=$uri | Select-String -SimpleMatch $user)
if ($acls.count -eq 0 ) {
Write-Host "Setting rights for '$user' on $uri"
netsh http add urlacl url=$uri user=$user | Write-Host
} else {
Write-Host "Rights already set for '$user' on $uri."
}
}
DeployUtil.ps1
03.06.2014 / 68
function Get-Port($config)
{
Write-Host "Reading config file '$config'"
$found = $FALSE
$appConfig = [xml](cat .$config)
$appConfig.configuration.appSettings.add | foreach {
if ($_.key -eq 'Port') {
$port = $_.value
$found = $TRUE
}
}
if (-not $found) {
$port = "8080“
}
$($port)
}
AUTOMATING YOUR PROCESS
03.06.2014 / 69
Automating your process
• Create environments and projects
• Add all the automated build steps you can
• Add manual steps for the rest
• Automate manual steps one by one
• You can have more than one tentacle on a server
– Not as a service
03.06.2014 / 70
CONNECTING THE ISSUE TRACKER
03.06.2014 / 71
Connecting the issue tracker
• Connect TeacmCity throught Settings – Issue Tracker
• Connect your issue tracker to TeamCity
• Use the Issue tracker’s web api to get issues pending user acceptance
– Add them to releasenotes while deploying
03.06.2014 / 72
Kristoffer Rolf Deinoff
Lead Technologist
@gatepoet
kristoffer.deinoff@itera.no

More Related Content

PDF
Future of Web Apps: Google Gears
KEY
Deploying
PDF
Service Worker - Reliability bits
KEY
#NewMeetup Performance
PDF
Meetup Performance
PDF
Service workers
PDF
Icinga2 Hacking Session 2014-10-10
PDF
Introduction to Chef
Future of Web Apps: Google Gears
Deploying
Service Worker - Reliability bits
#NewMeetup Performance
Meetup Performance
Service workers
Icinga2 Hacking Session 2014-10-10
Introduction to Chef

What's hot (20)

KEY
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
PDF
Service workers
PDF
Choosing a Javascript Framework
PDF
JQuery UK February 2015: Service Workers On Vacay
PDF
JQuery UK Service Workers Talk
PDF
Service Worker Presentation
PPTX
PowerShell: Through the SharePoint Looking Glass
PDF
[Bristol WordPress] Supercharging WordPress Development
PPTX
Real World Lessons in Progressive Web Application & Service Worker Caching
PPTX
Progressive What Apps?
PDF
Environments - Fundamentals Webinar Series Week 5
PDF
Common configuration with Data Bags - Fundamentals Webinar Series Part 4
PPTX
SPSSTL - PowerShell - Through the SharePoint Looking Glass
PDF
[1C1]Service Workers
PDF
Rebooting a Cloud
PDF
Symfony Deployments on Heroku
PDF
Instant and offline apps with Service Worker
PDF
We broke up with the monolith, and started dating #eventSourcing - #symfonyCat
PPTX
SPSTC - PowerShell - Through the SharePoint Looking Glass
PPTX
Eddystone Beacons - Physical Web - Giving a URL to All Objects
modern module development - Ken Barber 2012 Edinburgh Puppet Camp
Service workers
Choosing a Javascript Framework
JQuery UK February 2015: Service Workers On Vacay
JQuery UK Service Workers Talk
Service Worker Presentation
PowerShell: Through the SharePoint Looking Glass
[Bristol WordPress] Supercharging WordPress Development
Real World Lessons in Progressive Web Application & Service Worker Caching
Progressive What Apps?
Environments - Fundamentals Webinar Series Week 5
Common configuration with Data Bags - Fundamentals Webinar Series Part 4
SPSSTL - PowerShell - Through the SharePoint Looking Glass
[1C1]Service Workers
Rebooting a Cloud
Symfony Deployments on Heroku
Instant and offline apps with Service Worker
We broke up with the monolith, and started dating #eventSourcing - #symfonyCat
SPSTC - PowerShell - Through the SharePoint Looking Glass
Eddystone Beacons - Physical Web - Giving a URL to All Objects
Ad

Viewers also liked (9)

PDF
XL Release Webinar Slides: Enterprise Release Management for DevOps & Continu...
PPTX
uTest STPcon spring 2012 presentation
PDF
Things you should know about Scalability!
PDF
Continous delivery with Jenkins and Chef
PDF
Puppet: What _not_ to do
PPTX
Automated release management with team city & octopusdeploy - NDC 2013
PDF
Continuous Deployment at Lean LA
ZIP
Ops Meta-Metrics: The Currency You Pay For Change
PDF
Continuous Delivery
XL Release Webinar Slides: Enterprise Release Management for DevOps & Continu...
uTest STPcon spring 2012 presentation
Things you should know about Scalability!
Continous delivery with Jenkins and Chef
Puppet: What _not_ to do
Automated release management with team city & octopusdeploy - NDC 2013
Continuous Deployment at Lean LA
Ops Meta-Metrics: The Currency You Pay For Change
Continuous Delivery
Ad

Similar to Automated release management - DevConFu 2014 (20)

PDF
Introduce to PredictionIO
PDF
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
PDF
Andrey Adamovich and Luciano Fiandesio - Groovy dev ops in the cloud
PDF
Practical Chef and Capistrano for Your Rails App
PDF
Burn down the silos! Helping dev and ops gel on high availability websites
PDF
Lean Php Presentation
PDF
The Peanut Butter Cup of Web-dev: Plack and single page web apps
PDF
Testing with PostgreSQL
PPTX
Sherlock Homepage - A detective story about running large web services - WebN...
PPT
nodejs tutorial foor free download from academia
PDF
Max Voloshin - "Organization of frontend development for products with micros...
PPTX
Kraken
PDF
Introduction to node js - From "hello world" to deploying on azure
PPTX
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
PDF
Google Cloud Endpointsによる API構築
KEY
From Dev to DevOps - FOSDEM 2012
PDF
Kraken Front-Trends
PPTX
Sherlock Homepage - A detective story about running large web services (VISUG...
PPTX
Sherlock Homepage (Maarten Balliauw)
PDF
Supercharging WordPress Development - Wordcamp Brighton 2019
Introduce to PredictionIO
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Andrey Adamovich and Luciano Fiandesio - Groovy dev ops in the cloud
Practical Chef and Capistrano for Your Rails App
Burn down the silos! Helping dev and ops gel on high availability websites
Lean Php Presentation
The Peanut Butter Cup of Web-dev: Plack and single page web apps
Testing with PostgreSQL
Sherlock Homepage - A detective story about running large web services - WebN...
nodejs tutorial foor free download from academia
Max Voloshin - "Organization of frontend development for products with micros...
Kraken
Introduction to node js - From "hello world" to deploying on azure
Deploy and Destroy: Testing Environments - Michael Arenzon - DevOpsDays Tel A...
Google Cloud Endpointsによる API構築
From Dev to DevOps - FOSDEM 2012
Kraken Front-Trends
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage (Maarten Balliauw)
Supercharging WordPress Development - Wordcamp Brighton 2019

More from Kristoffer Deinoff (6)

PPTX
There's no place like home office
PPTX
Internet of machine learning - BuildStuff '14
PPTX
Internet of machine learning - AI Ukraine '14
PPTX
Continuous delivery in the cloud - DevConFu 2014
PPTX
This is how i roll!
PPTX
Hør etter da!
There's no place like home office
Internet of machine learning - BuildStuff '14
Internet of machine learning - AI Ukraine '14
Continuous delivery in the cloud - DevConFu 2014
This is how i roll!
Hør etter da!

Recently uploaded (20)

PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
System and Network Administration Chapter 2
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPT
Introduction Database Management System for Course Database
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Softaken Excel to vCard Converter Software.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Nekopoi APK 2025 free lastest update
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms II-SECS-1021-03
Operating system designcfffgfgggggggvggggggggg
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
System and Network Administration Chapter 2
Which alternative to Crystal Reports is best for small or large businesses.pdf
history of c programming in notes for students .pptx
L1 - Introduction to python Backend.pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Introduction Database Management System for Course Database
2025 Textile ERP Trends: SAP, Odoo & Oracle
PTS Company Brochure 2025 (1).pdf.......
VVF-Customer-Presentation2025-Ver1.9.pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Softaken Excel to vCard Converter Software.pdf

Automated release management - DevConFu 2014