DevOps: Integration, Deployment - Continuous Delivery


msbuild, psake, powershell, nuget, chocolatey,
octopus deploy, azure


March 16, 2013
Leblanc Meneses
Improving Startups
817-226-5740
leblanc@
leblancmeneses
@leblancmeneses
leblancmeneses

"Why" you need this!

downward spiral

Gene Kim - PuppetConf 2013

Continuous Delivery

continuous delivery

Continuous Delivery: Reliable Software Releases Through Build, Test, and Deployment Automation
Jez Humble, David Farley

Why NOW?

  • Most CI talks ignore the Deployment problem or fail to provide repeatable steps
  • Nuget
  • Powershell

CI - Continuous Integration

  • Reduce Risk, Fail fast, Learn Fast
  • Allows you to scale software development from 1 dev to 100+ devs
  • Popular Packages: TeamCity, TFS TeamBuild, cloud providers
  • Bad processes can cost a company $25 day per developer. $6,500 yr per developer; Average team size (5): $32,500/yr of waste

CI - Integration Problems 101

  • Distributed teams + Zero shared infrastructure
  • DevId - Each developers should be able to run code locally
  • DevEnvironment - Each developer should be able to run software without shared infrastructure
  • DevBranch - Each developer should be able to work on multiple branches at the same time
  • DevTask - UI designers / integration (mocked services)
  • DevProduct - gold/silver/bronze/; C1/C2/C3/C4

CI - How it looks

continious integration

CI - Configuration Risk

  • XDT - Web.config Transformations - To handle DevId, DevEnvironment, DevBranch, DevTask, DevProduct - would require to many files to handle all possible permutations using baked in VS2010 support.
configurations

CI - Configuration Risk

2009-2010 - FlexibleConfig - built with NPEG

flexible config

CI - Database Change Management

  • Database Change Management (.sql): 00006-register-RobustHaven.SqlClr.sql Roundhouse, RH DbChangeManagement
legend
Backup, restore, change management, obfuscate
database migration
database backup
Database prefix
Local requires branch name (devs working on multiple branches)
Staging environments - test/general/future do not - always on one branch of the code - so branch is not used

CI - Infrastructure Change Management

  • Infrastructure Change Management (.ps1): 0001-surveybinding-FlatRock.ENV.production.NODE.srvweb1.srvweb2.ps1
Infrastructure Change Management

CI Staging Environments

Hyper-V - sysprep (IIS/MSMQ/Window Services)

hyper-v

MSBuild vs PSake

msbuild psake

MSBuild the good

  • MVCContrib portable areas - Embedded Resources embedded resources
  • NSeviceBus - generic host NServiceBus generic host

CI - Triggering Practices

  • On checkin - vcs to build & test
  • Scheduled for nightly automated integration tests
  • Schedule for production like sync
  • Trigger dependencies to build
  • CI - Build, Test, Obfuscate, Package, Create artifacts consumed by CD environment
  • Manual Trigger - deploy

CD - Continuous Deployment

continuous deployment
  • Web Deploy + Web Farm Framework #FAIL
  • Udeploy - Expensive
  • Thoughtworks GO
  • Octopus Deploy
    • Redgate Deployment Manager - Fork of old version of Octopus Deploy
  • Chocolatey

Octopus Deploy

  • Octopus Server
    • Radiates Information on dashboard
  • Nuget Packages, Nuget Server
  • Tentacle Agent
    • Responsible to deploy on specific machine
  • REST API - Octopus-Tools (github)
    • CI - auto deploy to staging environments and production

Octopus Deploy Server - How it looks

octopus deployoctopus deploy
Migrating Octopus Server:
Raven.Smuggler.exe in
http://localhost:10930/ c: ile.octobak

Link Servers to ENV and Roles

configuration

CD Steps

  • Window Services (NServiceBus / TopShelf)
  • Websites (IIS individual appdomain)
  • LanguageWorkbench
    • (non iis or winservice)
action
scripts

CD Vars

Nuget Packages

nugetnuget
nugetnuget
Promote-deployment

Nuget Server

  • Initially use Nuget package - File based server
  • If you are storing a lot of packages for a long period of time - Lucene version - Klondike
  • TeamCity
nuget

Tentacle Agent

tentacletentacle
-w c:{{'\'}}workingdirectory

REST API - Ties CI with CD

Octopus Deploy (411)

  • Octopus Documentation
  • Octopus Blog - #RFC on features, Ideas, dev topics
  • https://github.com/OctopusDeploy
  • @octopusdeploy
  • @paulstovell
  • @stevenkuhn
octopus

ETL process - Nation Wide

  • Octopus Deploy -
    • Great when you manage all the infrastructure
    • Great for dashboard that radiates visibility of deployments for everyone (testers, devs, business)
    • Octopus Deploy V2 when dealing with 3rd party infrastructure due to Firewall (push/pull)
  • Chocolatey - No need to open firewall. No central server that radiates information.
octopus

Azure Cloud - xpat-cli

Powershell -> xplat-cli -> to use jq.exe
You don't need Octopus Deploy - however I like a centralized dashboard, high level orchestration, 1 tentacle deploying with apis onlyoctopus

Feedback

Leblanc Meneses
Improving Startups
817-226-5740
leblanc@
leblancmeneses
@leblancmeneses
leblancmeneses