continuous delivery with tfs msbuild msdeploy

Post on 20-Aug-2015

11.673 Views

Category:

Education

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

With msbui ld and msdeploy

Continuous DeploymentDeliv

ery -----------

Abstract

If you are deploying your software manually, you are doing it wrong.

If you deploying once a month, you are doing it wrong.

If you as a developer are deploying from Visual Studio by clicking "Publish", you are doing it wrong.

If a bug-fix takes you 1 hour but your customer needs to wait a week until he gets it, you are doing it wrong.

 

Manual deployments are NOT fun.

There is a nice way on how to automate the deployment with TFS 2010, msbuild and msdeploy.

http://twitter.com/#!/DEVOPS_BORAT/status/76767436543758336

Continous Deployment

Deploy continously...

After each change...

To a certain env...

Continous Delivery

Be production ready...

through dev cycle...

release any time...

Peter Gfader

Australia (my fun)

Italy (my country)

German (my language)

blog.gfader.com (my findings)

@peitor (my conversations)

www.SSW.com.au (my company)

Deployment Agenda

1. Pain

2. Goals

3. How To1. Start from scratch

2. Existing System

4. Best Practices

How do you deploy?

How do you deploy?

• Web App• Client App• SharePoint• CRM

...

• Manual• Publish from VS• Xcopy• Deploy.docx• Deploy.ps

Pain

"Only Bob knows how to deploy

... And he is on holidays..."

http://twitter.com/#!/DEVOPS_BORAT/status/55321627000455168

Manual deployments

are error prone

Microsoft Word Document

Deployment Instructions.docx

Manual deployments

take hours instead of minutes or seconds

Microsoft Word Document

Deployment Instructions.docx

Manual deployments

take hours instead of minutes or seconds

Long feedback cycle We want fail fast

Microsoft Word Document

Deployment Instructions.docx

Deployments late in the development process

cause stress on the "deployment day"

Hard!

1. Configuration

2. Existing data

3. Updates

4. Starting/Stop

5. External dependencies

Manual != fun

http://twitter.com/#!/DEVOPS_BORAT/status/62745218931359744

Goals

Deliver business value faster

Deliver business value faster

You spent an hour on a bug fix, but customers will not see it for months

http://twitter.com/#!/DEVOPS_BORAT/status/82255123526598656

Fail fast and early in the development process

Fail fast and early in the development process

On the "Go Live Day" you realize: Production hardware is missing an important feature

Release small increments

Release small increments

Deploying often, less number of defects

Start from scratch

http://continuousdelivery.com/2010/02/continuous-delivery/

T h i s i s t h e h a r d p a r t , b u t s o m e r u l e s o f t h u m b

How To

How To

1. Start from Scratch

2. Existing Environment

Start from scratch

Start from scratch

1. Setup Continous Integration

Start from scratch

1. Setup Continous Integration

1. CI tools• TFS• TeamCity • CruiseControl.NET

Start from scratch

1. Setup Continous Integration1. CI tools

2. Build automation• msBuild• nAnt• nRake• FinalBuilder

Start from scratch

2. Have automated tests

Start from scratch

2. Have automated tests1. Unit

2. Integration

3. Smoke

4. Acceptance

5. Stresstest

6. BVT

7. WTF?

3. Setup packaging software

3. Setup packaging software

3. Setup packaging software

3. Setup packaging software

Result

Install of package ----------- - ---

4. Configuration

4. Configuration

1. XML Transforms vs

2. XML Parametrization

1. Web transforms

• Applied on every deployment• Part of VS2010 (no UI)• XML transform engine is

wrapped in msBuild

1. Web transforms

• Everything that is not environment specific

1. Web transforms

• Everything that is not environment specific

• E.g.Remove all dev settings• Debug options• ..

2. Web parameterization

• Applied on every deployment• Run through msDeploy

2. Web parameterization

2 parts1. Declare parameters

2. Set parameters

Additional Configuration settings

Declare Parameters

Set Parameters

Set Parameters

4. Target environments

Run

Run

Existing Environment

Deployment Instructions.docx

Existing Environment

1. Document your manual deployment process• Software artefacts• Configuration artefacts• Target environment(s)

http://twitter.com/#!/DEVOPS_BORAT/status/54693053142798336

Existing Environment

2. Improve in baby steps1. Identify your most expensive

manual step

2. Automate that

3. Rinse and repeat

Existing Environment

Everyone should work together

Deployment @AuctionsPlus

On a napkin

Automated Deployment

Wed night @Sydney .NET UG

Best practices

http://twitter.com/#!/DEVOPS_BORAT/status/65880152705470464

Deploy early

Deployment is never easy, so try to deploy as soon as possible to remove all roadblocks

http://twitter.com/#!/DEVOPS_BORAT/status/61213294949707776

Have a rollback plan

Have a Dashboard

• Latest Builds?• Environment, version?• Everything healthy?

Have a guinea pig

AB testing

Have a clone of your production environment

Have everything under source control

Have everything under source control

Deployment artefacts

1. .bat

2. .ps

Log failed and successful builds

Only let the PO deploy to Production

Automate

Automate

Automate

AutomateAutomateAutomateAutomateAutomate

Automate

Deployment Agenda

1. Pain

2. Goals

3. How To1. Start from scratch

2. Existing System

4. Best Practices

References

Do you automate your deployment process? (aka Continuous Deployment)

http://blog.gfader.com/2010/12/do-you-automate-your-deployment-process.html

Slides and all details

http://blog.gfader.com

Thank you!

top related