continuous delivery story with fifa (wroc.net - 2012.12.11)

49
12.12.2012 © MAKING WAVES 1 Continuous delivery story with FIFA Introducing best practices in legacy project Mirosław Jedynak Architect @ Making Waves

Upload: miroslaw-jedynak

Post on 15-Jan-2015

167 views

Category:

Technology


0 download

DESCRIPTION

Continuous Delivery is the process of having a shippable product after each check-in to the source control repository. Continuous Delivery is usually implemented as a natural improvement of a Continuous Integration process. This presentation highlights challenges and presents hints on how to start from a raw environment and incrementally build a successful deployment pipeline based on Team Foundation Server (TFS), providing substantial added-value for business. This presentation will describe the process of establishing Continuous Delivery in a project for FIFA. We describe the starting point, what we achieve in the first phases and what are the plans for further improvements in order to deliver high quality software in schedules defined by business needs – not by process and technology constraints. http://blog.m.jedynak.pl/2012/06/continuous-delivery-story-with-fifa.html

TRANSCRIPT

Page 1: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 1

Continuous delivery story with FIFA

Introducing best practices in legacy project

Mirosław Jedynak

Architect @ Making Waves

Page 2: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Maslow’s hierarchy

12.12.2012 2

Self-esteem

Friends, family

Security of body,

employment

Breathing, food, sleep

Creativity

Page 3: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Revisable

• Source control

• Revert, branch and merge

• No zip files/shared disk

12.12.2012 3

Revisable

PROPOSED BY SCOTT HANSELMAN

Page 4: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Buildable & deployable

• Able to compile code

• Built automatically

• Deploy as easily as you can build it

12.12.2012 © MAKING WAVES 4

Buildable & deployable

Revisable

PROPOSED BY SCOTT HANSELMAN

Page 5: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Maintainable

• Able to fix bugs

• Verify them

• Any tests at all?

12.12.2012 5

Maintainable

Buildable & deployable

Revisable

PROPOSED BY SCOTT HANSELMAN

Page 6: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Refactorable

• Follow conventions

• Refactor without fear

• Automated unit tests

12.12.2012 6

Refactorable

Maintainable

Buildable & deployable

Revisable

PROPOSED BY SCOTT HANSELMAN

Page 7: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Pride

• „It’s clear to me”

• „Ok, John was here”

12.12.2012 7

Refactorable

Maintainable

Buildable & deployable

Revisable

Pride

PROPOSED BY SCOTT HANSELMAN

Page 8: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

source: www.wesport.org.uk

Page 9: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 0 Inherited project evaluation

Page 10: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 11

Clever solutions

Page 11: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 12

Code duplication

Page 12: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 1 Transfer source control

Page 13: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Revisable at FIFA

12.12.2012 © MAKING WAVES 14

• Multiple SVN repositories

– Code duplication between repositories

– Missing revisions

• Sometimes challenging to obtain code deployed to production

– Assemblies without clear source

– Not versioned

• Changes directly on production

– In markup (aspx)

– In assemblies

Refactorable

Maintainable

Buildable & deployable

Revisable

Pride

Page 14: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 2 Automate build

Page 15: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

practice where team members integrate their work frequently, usually at least daily - leading to multiple integrations per day

Continuous Integration

Page 16: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Single Source Repository

Automated Build

Self-testing

Easy to get the latest executable

Page 17: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 3 Establish internal test environment

Page 18: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

• Manual test suite

– Army of testers

– Functionality exploration

– Regression

– Input for automation

Testing - inheritance

12.12.2012 © MAKING WAVES 21

Page 19: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

• Unit tests

– Hard to introduce

• Functional acceptance tests

– UI tests

– Fragile

• Smoke tests

– Useful when automating deployment

Testing - improvements

12.12.2012 © MAKING WAVES 22

Page 20: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

• Similar to production

– Operating system/IIS version

– Load balancer

• Isolated

• Mocked external systems

Testing environment

12.12.2012 © MAKING WAVES 23

Page 21: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

How long would it take in your organization to deploy a change that involves just a single line of code?

How long would it take to set up production environment when your data center blows up?

Page 22: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Project goal:

shorten release cycle

Page 23: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

a set of practices and principles aimed at building, testing and releasing software faster and more frequently.

Continuous Delivery

Page 24: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Last mile

12.12.2012 27

Last mile

UAT IT

Page 25: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 28

Developer

Customer

IT

Customer

Focus of last 10 years Focus of continuous delivery

Page 26: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 29

Principles behind the Agile Manifesto

http://agilemanifesto.org/principles.html

We follow these principles:

Our highest priority is to satisfy the customer

through early and continuous delivery

of valuable software.

Welcome changing requirements, even late in

development. Agile processes harness change for

the customer's competitive advantage.

Deliver working software frequently, from a

couple of weeks to a couple of months, with a

preference to the shorter timescale.

Business people and developers must work

together daily throughout the project.

Build projects around motivated individuals.

Give them the environment and support they need,

and trust them to get the job done.

The most efficient and effective method of

conveying information to and within a development

Page 27: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 4 Convince customer – business value

Page 28: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Business value

• Feedback from users

– Competitive advantage

– Fail fast and early

12.12.2012 © MAKING WAVES 31

Page 29: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Ch

an

ge

Time

Business value

12.12.2012 © MAKING WAVES 32

Ch

an

ge

Time

frequently

less changes

• Feedback from users

– Competitive advantage

– Fail fast and early

• Reduced risks of release

– Automated

• Real progress

– Definition of done

• Quicker return of investment

Page 30: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Examples

12.12.2012 © MAKING WAVES 33

Waiting for 151 hosts

Page 31: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Examples

12.12.2012 © MAKING WAVES 34

Page 32: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Most software developed by large teams spends a significant proportion of its development time in an unusable state.

Page 33: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Waterfall

Deployment – bad parts

Black art

„All hands on board”

„We deploy on Saturday”

Page 34: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 5 Design deployment pipeline

Page 35: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 38

Deployment pipeline

Version

control

Build &

unit test

Acceptance

tests

Acceptance

tests Release

Artifacts repository

Dev Tester/PO PO

Page 36: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

When it hurts, do it more often

Page 37: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 6 Manage environment configuration

Page 38: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

It’s easier to break system by changing one line of config than one line of code

Page 39: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Configuration types

12.12.2012 © MAKING WAVES 43

Environment Environment

+

Application

Application

Page 40: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Configuration templating

12.12.2012 © MAKING WAVES 44

Configuration

template Environment-

specific

configuration

Environment

&application

specific

Deployment

package

Page 41: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Hotfix

* Rollback

* Deploy last good version

* Rollback scripts less tested than deployment

* Avoid Fix-forward fire

* Hotfix

* Follow regular deployment pipeline

* It is a tested path

* It has known time of deployment

Troubles

Page 42: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Day 8 Deploy to production

Page 43: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 49

• Deploy continuoulsy

• After each change

Continuous deployment

Continuous delivery • Be production ready

• Release any time

Page 44: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Best practices How we get there

Page 45: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

• Version everything

• Similar environment

• Automate existing procedure

• Manage configuration

• Most expensive/risky first

• Deploy never easy - try as soon as possible

Best practices - Summary

12.12.2012 © MAKING WAVES 51

Page 46: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Doubts/Fears

• Setup time

– Sum up deployment and fix times

• Replacing software

– Release to beta environment for early adopters

• Confidence in automation

– Do it more often

12.12.2012 © MAKING WAVES 52

Page 47: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 53

Q&A Mirosław Jedynak [email protected]

Page 48: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

Database deployment

• separate database migrations

– expansion scripts - changes not breaking backwards compatibility with the existing version

– contraction scripts - clean up any database structure that is no longer needed

App

v1.0

Expansion

script v2.0

App

v2.0

Contractions

cript v2.0

Page 49: Continuous Delivery story with FIFA (Wroc.net - 2012.12.11)

12.12.2012 © MAKING WAVES 55