Continuous Delivery

Preview:

DESCRIPTION

from JavaDays Riga '12

Citation preview

Andrzej Grzesik

CONTINOUS DELIVERY

Andrzej Grzesik

Present

Past

ABOUT:ME

I HATE COMPUTERSdisclaimer

GEECON 201317th-19th May, Krakow, Poland

I HATE COMPUTERSdisclaimer

QUESTIONS?ask them right away!

GREAT BOOKS!

FACTS FIRST

is more fun than

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.

DELIVERY

DELIVEREDwhen?

DEPENDS…(ultimate answer in computers)

#DEFINE DONE

WHAT IS DONE?

WHAT IS DONE?

WHAT IS DONE?

Coded

WHAT IS DONE?

ReviewedCoded

WHAT IS DONE?

Checked-inReviewedCoded

WHAT IS DONE?

Checked-inReviewed BuiltCoded

WHAT IS DONE?

Checked-inReviewed Built TestedCoded

WHAT IS DONE?

Checked-inReviewed Built DemoedTestedCoded

NOT REALLY :-)

#REDEFINE DONE

NOT READY TILL DEPLOYED

DONE === RELEASED

build&

deploy&

measure&

data&

learn&

ideas&

ERIC RIES, THE LEAN STARTUP

If we can reduce the time between major iterations

we can increase our odds of successEric Ries, Lean Startup

RELEASESgive us

FEEDBACK!

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

Do you do this on a repeatable, reliable basis?

Mary and Tom Poppendieck,Implementing Lean Software Development

RELEASE == FEEDBACK

REPEATABLE FEEDBACK

HOW?!

THE DEPLOYMENT PIPELINEentreth:

THE DEPLOYMENT PIPELINE

THE DEPLOYMENT PIPELINE

compile

THE DEPLOYMENT PIPELINE

unit testcompile

THE DEPLOYMENT PIPELINE

unit testcompile

package

THE DEPLOYMENT PIPELINE

unit testcompile

package

artifact repository

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

artifact repository

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

artifact repository

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing

artifact repository

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing Release

artifact repository

BUILD ONLY ONCE!

THE DEPLOYMENT PIPELINE

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

artifact repository

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing

artifact repository

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing Release

artifact repository

THE DEPLOYMENT PIPELINE

THE DEPLOYMENT PIPELINE

Acceptance testing

Capacity testing

THE DEPLOYMENT PIPELINE

Acceptance testing

Capacity testing

Manual testing

THE DEPLOYMENT PIPELINE

Acceptance testing

Capacity testing

Manual testing Release

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing Release

artifact repository

fear!

AUTOMATE EVERYTHING!(almost)

AUTOMATE EVERYTHING!

AND?

WELL, IT’S BIG

ALL CODE IS PRODUCTION READY

EVERY VERSION IS A RELEASE CANDIDATE

QUALITY GOES UPpeople care

PRO TIP: --VERSION

WHY VERSIONS?

185.0.1is more friendly than

0cdfc45df874354265b3be910b52c41398de79ca

ANTIPATTERNS

DEPLOYING RARELY/LATEsymptomps: “alpha”, “beta”, “gold”

LATE FIRST CONTACT WITH REALITY

UNREALISTIC ASSUMPTIONS

WELL TESTED IN.. DEV

DEPLOYING MANUALLYis evil!

ERROR-PRONE

http://www.flickr.com/photos/aaronjacobs/64368770/

ALWAYS DIFFERENTrepeatable

IMPOSSIBLE TO TEST

THE “DEPLOY” TEAM

DO YOU AVOID DEPLOYS?

HOW OFTEN DO YOU DEPLOY?

IF IT HURTSDO IT MORE OFTEN!

practice, practice, practice

INCREMENTAL, FREQUENT RELEASES REDUCE RISK

PROVIDE DATA

GIVE ROLLBACK POINTS

SOME STATS

Facebook - every 10 minutes

Etsy - 50-60 deploys/day

GitHub - >50 deploys/day

project X - 1374 commits, 1057 deployments, <8 months

ENVIRONMENTS

IF I ERASED ALL YOUR PRODUCTION MACHINES, HOW LONG WOULD YOU NEED

TO BE BACK UP?

WELL, CODE IS IN GIT mercurial, subversion, ClearCase, whathaveyou

IMAGINE:

http://www.flickr.com/photos/roadhunter/68017745/

INFRASTRUCTURE AND CONFIGURATION IS JUST AS IMPORTANT

VERSION IT!(puppet, chef, etc)

BEFRIEND SOME ADMINS :-)

AND VERSION EVERYTHING

MANUAL CONFIGURATION OF ENVIRONMENTS

PRIVILEGED DEPLOY TEAM

NOT REPEATABLE

SLIGHT DIFFRENENCES

DOESN’T SCALE

HARD TO TRACK

ROLLBACK, ANYONE?

TRUCKS

MEANWHILE, IN THE REAL WORLD

MY SYSTEM IS ***

WHERE TO START?

WITH PRODUCTIONand fix things backwards

AUTOMATE DEVELOPMENTand bring automation forward

DEPLOYShow do I?

DEPLOYS

• blue-green

• canary

• emergency fixes

BLUEGREEN

traffic

FULL BLUEGREEN IS COSTLYbut great for availability

CANARY

old old old

newold old old

new

EMERGENCY FIXES

EMERGENCY FIXESgo the same way

DON’T BREAK RULES

CAVEATS!

STATE

LONG RUNNING *

MAYBE EVENT SOURCING?

VERSION YOUR ENTITIESand code accordingly

BRANCHING

if your system looks like that

CUT!

• have integration tests

• have a “test” system

DESKTOPS

• LOVE your autoupdate

• build-in version checking and inform user

DESKTOPS

Do or

LOVE YOUR AUTOUPDATE

PUSH USER UP

IN PRACTICE

MODULES^N

PRE-TESTED COMMITSrock, a bit

DVCSrock, a lot!

VMSrock a lot!

THERE ARE TOOLS

IS AWESOMEbut

+

GLUhttp://linkedin.github.com/glu

GO ($$$)

PALDIES!kthxbye!

@ags313andrzej@grzesik.itandrzejgrzesik.info

tweet please!

RESOURCES

• http://continuousdelivery.com

• http://lmgtfy.com/?q=continuous+delivery

Recommended