FILE -> NEW PROJECT TO
DEPLOY IN 10 MINUTES WITH
TEAMCITY AND OCTOPUS
DEPLOY
(and PowerShell)

London/NDC London

Tomas Ja...
Tomas Jansson
Manager & .NET Group Lead
BEKK Oslo
Norwegian .NET User Group
@TomasJansson
tomas.jansson@bekk.no
github.com...
My story
What I
didn’t see I
didn’t know

http://www.thewallpapers.org/photo/23036/Meadow-And-Trees.jpg
One day I
did the
deploy

http://1.bp.blogspot.com/-AuV-3M279Yw/TvFwqK2SJFI/AAAAAAAAPss/avHyNeySJwU/s1600/recipes+002.JPG
But the
result!

http://th05.deviantart.net/fs34/PRE/f/2008/294/9/5/Messy_kid_by_Hollie32.jpg
Tomas angry

http://subcultureforthecultured.com/wp-content/uploads/2012/05/hulk1.jpg
The result!

http://img.directindustry.com/images_di/photo-g/blister-packaging-machines-60364-2546945.jpg
WHAT I WANT YOU TO EXPERIENCE TODAY

Some tips and tricks for Teamcity
Experience Octopusdeploy
Get to appreciate PowerShe...
WHY CONTINUOUS DEPLOYMENT?

Bug impact

Features

Time

Shorter time between releases
 smaller impact

New features faste...
WHY CONTINUOUS DEPLOYMENT?

Bug impact

Money

Time

Shorter time between releases
 smaller impact

New features faster ...
WHERE SHOULD I START?

Visualize what is needed for you to make a complete deployment

Build

Test

(5 min)

(5 min)

Prov...
WHAT CAN I DO?

Build

Test

Deploy

Smaller solutions

Minimize DB-test/test setup

Clear artifacts

Decouple projects

M...
Repetitive

The
Goal
Automated

One
artifact
CONCEPTUAL SETUP

Dev

Test

Developers

Deployment
manager

Prod

VCS

Build server

Artifact repository
THE GOAL
Tools

http://api.ning.com/files/wi*oWNYzff-TE0NdSZQIetMjtPWOTyiTLnYIS91gI2PE-zRWP1h2dBj79yb-nK0AghzWRpShzOmdbE9LsAnGLqa1M...
TEAMCITY

Continuous integration engine
JetBrains
Free for small teams
KEY FEATURES: TEAMCITY

Templating

Build template

Project X
Project X
Project X
Build Project X

Dependencies

Deploy te...
OCTOPUS DEPLOY

Automated deployment for .NET (Windows)
•

Created by Paul Stovell (@paulstovell)

•

Targeting .NET

•

C...
NUGET & OCTOPUS DEPLOY
NUGET & OCTOPUS DEPLOY

Pull deploy
from v 2.0!
Octopus deploy is eating
their own dog food since
v 2.0.
Web application is using
the public REST API.

http://petcountrys...
OCTOPUS DEPLOY PROCESS

•
•

Pre
deploy
•

Run transformations of
config files

•

Octopus does IIS setup

Check environme...
OCTOPUS CONCEPTS

Environments

Roles

An environment contains one or many machines

Defines where to deploy

Adding a mac...
OCTOPUS CONCEPTS

Project groups

Project

A collection of projects

Definition of what to deploy

Map environment to proj...
OCTOPUS CONCEPTS

Release package

Deploy

A definition of a release

An actual deploy of a release

Has a version number
...
PowerShell
GETTINGS STARTED WITH PROGRAMMING IIS IN POWERSHELL

> Import-Module WebAdministration
> $iisAppPoolsPath = "IIS:AppPoolsM...
BETA Demo!

http://www.mrwallpaper.com/wallpapers/despicable-me-hitman-minion-1920x1080.jpg
SUMMARY

•

Continuous deployment doesn’t have to be hard

•

The right tools will help you a long way (TeamCity and Octop...
RESOURCES

Blog post about the setup: http://tinyurl.com/PowerOctoTeam
Octopus Deploy: http://www.octopusdeploy.com
TeamCi...
Questions?
Thank you!
@TomasJansson
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy
Upcoming SlideShare
Loading in...5
×

File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy

1,455

Published on

Introduction to Octopus Deploy and TeamCity and why you should use it.

Published in: Technology, Self Improvement
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,455
On Slideshare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Present thetopic Deployment
  • Trenger en ny profilbilde
  • Minimizeimpactofbugs long lead time thebugswill have more affect and youneed to take more seriousdecisionaboutwhat to doMinimize time for fix automated (fast) deploy makes it easier to release a fix fasterMore time for whatyouaresupposed to do
  • Minimizeimpactofbugs long lead time thebugswill have more affect and youneed to take more seriousdecisionaboutwhat to doMinimize time for fix automated (fast) deploy makes it easier to release a fix fasterMore time for whatyouaresupposed to do
  • I haven’tevenmentioned risk here,whichalsoshould be takenintoaccount
  • Things I have deployed: .NET web applications, Web services, EPiServer, SharePoint, Database migrations, Windows Services
  • File -> new project to deploy in 10 minutes with TeamCity and Octopus Deploy

    1. 1. FILE -> NEW PROJECT TO DEPLOY IN 10 MINUTES WITH TEAMCITY AND OCTOPUS DEPLOY (and PowerShell) London/NDC London Tomas Jansson 06/12/2013
    2. 2. Tomas Jansson Manager & .NET Group Lead BEKK Oslo Norwegian .NET User Group @TomasJansson tomas.jansson@bekk.no github.com/mastoj blog.tomasjansson.com
    3. 3. My story
    4. 4. What I didn’t see I didn’t know http://www.thewallpapers.org/photo/23036/Meadow-And-Trees.jpg
    5. 5. One day I did the deploy http://1.bp.blogspot.com/-AuV-3M279Yw/TvFwqK2SJFI/AAAAAAAAPss/avHyNeySJwU/s1600/recipes+002.JPG
    6. 6. But the result! http://th05.deviantart.net/fs34/PRE/f/2008/294/9/5/Messy_kid_by_Hollie32.jpg
    7. 7. Tomas angry http://subcultureforthecultured.com/wp-content/uploads/2012/05/hulk1.jpg
    8. 8. The result! http://img.directindustry.com/images_di/photo-g/blister-packaging-machines-60364-2546945.jpg
    9. 9. WHAT I WANT YOU TO EXPERIENCE TODAY Some tips and tricks for Teamcity Experience Octopusdeploy Get to appreciate PowerShell
    10. 10. WHY CONTINUOUS DEPLOYMENT? Bug impact Features Time Shorter time between releases  smaller impact New features faster  happier customers and improved learning Automated deploy  more time for development and happier developers
    11. 11. WHY CONTINUOUS DEPLOYMENT? Bug impact Money Time Shorter time between releases  smaller impact New features faster  happier customers and improved learning Automated deploy  more time for development
    12. 12. WHERE SHOULD I START? Visualize what is needed for you to make a complete deployment Build Test (5 min) (5 min) Provision server (1 hr) Deploy (20 min) Then ask the following questions: • How often do I do each step during a day/week/month? • Which step can I improve? My guess is; build, test, deploy and last provision of server
    13. 13. WHAT CAN I DO? Build Test Deploy Smaller solutions Minimize DB-test/test setup Clear artifacts Decouple projects Minimize network traffic Automated deploy Optimize code Repetitive Parallel testing
    14. 14. Repetitive The Goal Automated One artifact
    15. 15. CONCEPTUAL SETUP Dev Test Developers Deployment manager Prod VCS Build server Artifact repository
    16. 16. THE GOAL
    17. 17. Tools http://api.ning.com/files/wi*oWNYzff-TE0NdSZQIetMjtPWOTyiTLnYIS91gI2PE-zRWP1h2dBj79yb-nK0AghzWRpShzOmdbE9LsAnGLqa1M*u8zGMs/Swiss_Giant.jpg
    18. 18. TEAMCITY Continuous integration engine JetBrains Free for small teams
    19. 19. KEY FEATURES: TEAMCITY Templating Build template Project X Project X Project X Build Project X Dependencies Deploy template Project X Project X Project X Deploy Project X You can start using conventions for build and deploy Build Project X Deploy Project X
    20. 20. OCTOPUS DEPLOY Automated deployment for .NET (Windows) • Created by Paul Stovell (@paulstovell) • Targeting .NET • Currently in v 2.0 public beta
    21. 21. NUGET & OCTOPUS DEPLOY
    22. 22. NUGET & OCTOPUS DEPLOY Pull deploy from v 2.0!
    23. 23. Octopus deploy is eating their own dog food since v 2.0. Web application is using the public REST API. http://petcountrysupplies.co.uk/Dog%20Shop%20images/Dog%20Food/Dog%20Food.jpg
    24. 24. OCTOPUS DEPLOY PROCESS • • Pre deploy • Run transformations of config files • Octopus does IIS setup Check environment • Configure environment • Copy files needed for deploy • PostDeploy.ps1 • Delete files • Clean up Deploy.ps1 • PreDeploy.ps1 PowerShell is the key to great success! Deploy Post deploy
    25. 25. OCTOPUS CONCEPTS Environments Roles An environment contains one or many machines Defines where to deploy Adding a machine is done in one place instead of in every project Multiple machines can have the same role in one environment  deploy to multiple machines at once
    26. 26. OCTOPUS CONCEPTS Project groups Project A collection of projects Definition of what to deploy Map environment to project groups One project can multiple deploy steps Great if you have multiple customers A step can: • Deploy a NuGet package • Run a PowerShell script • Send an email • Require manual intervention • Deploy to Windows Azure • Upload files by FTP Variables can be configured per environment, role, machine and/or step
    27. 27. OCTOPUS CONCEPTS Release package Deploy A definition of a release An actual deploy of a release Has a version number Contains specific packages (version can differ from release version)
    28. 28. PowerShell
    29. 29. GETTINGS STARTED WITH PROGRAMMING IIS IN POWERSHELL > Import-Module WebAdministration > $iisAppPoolsPath = "IIS:AppPoolsMyAppPool" > New-Item $iisAppPoolsPath Name ---MyAppPool State ----Started Applications ------------ > $iisSitesPath = "IIS:SitesMySite" > New-Item $iisSitesPath -bindings @{protocol="http";bindingInformation="*:8321:*"} -physicalPath "c:tmp" Name ---MySite ID -5 State ----Stopped Physical Path ------------c:tmp Bindings -------http *:8321:* > Set-ItemProperty $iisSitesPath -name applicationPool -value "MyAppPool" > Start-Website "MySite"
    30. 30. BETA Demo! http://www.mrwallpaper.com/wallpapers/despicable-me-hitman-minion-1920x1080.jpg
    31. 31. SUMMARY • Continuous deployment doesn’t have to be hard • The right tools will help you a long way (TeamCity and Octopus deploy) • Learn PowerShell, it will make your life easier
    32. 32. RESOURCES Blog post about the setup: http://tinyurl.com/PowerOctoTeam Octopus Deploy: http://www.octopusdeploy.com TeamCity: http://www.jetbrains.com/teamcity/ OctoWebSetup GitHub project: https://github.com/mastoj/OctoWebSetup OctoWebSetup NuGet download: https://nuget.org/packages/OctoWebSetup/ Octopusdeploy automation script: https://gist.github.com/mastoj/7746853
    33. 33. Questions?
    34. 34. Thank you! @TomasJansson
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×