Continuous Delivery

154
Andrzej Grzesik

description

from JavaDays Riga '12

Transcript of Continuous Delivery

Page 1: Continuous Delivery

Andrzej Grzesik

Page 2: Continuous Delivery

CONTINOUS DELIVERY

Andrzej Grzesik

Page 4: Continuous Delivery

Present

Past

ABOUT:ME

Page 5: Continuous Delivery

I HATE COMPUTERSdisclaimer

GEECON 201317th-19th May, Krakow, Poland

Page 6: Continuous Delivery

I HATE COMPUTERSdisclaimer

Page 7: Continuous Delivery

QUESTIONS?ask them right away!

Page 8: Continuous Delivery

GREAT BOOKS!

Page 9: Continuous Delivery

FACTS FIRST

Page 10: Continuous Delivery

is more fun than

Page 11: Continuous Delivery

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

Page 12: Continuous Delivery

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

Page 13: Continuous Delivery

DELIVERY

Page 14: Continuous Delivery

DELIVEREDwhen?

Page 15: Continuous Delivery

DEPENDS…(ultimate answer in computers)

Page 16: Continuous Delivery

#DEFINE DONE

Page 17: Continuous Delivery

WHAT IS DONE?

Page 18: Continuous Delivery

WHAT IS DONE?

Page 19: Continuous Delivery

WHAT IS DONE?

Coded

Page 20: Continuous Delivery

WHAT IS DONE?

ReviewedCoded

Page 21: Continuous Delivery

WHAT IS DONE?

Checked-inReviewedCoded

Page 22: Continuous Delivery

WHAT IS DONE?

Checked-inReviewed BuiltCoded

Page 23: Continuous Delivery

WHAT IS DONE?

Checked-inReviewed Built TestedCoded

Page 24: Continuous Delivery

WHAT IS DONE?

Checked-inReviewed Built DemoedTestedCoded

Page 25: Continuous Delivery

NOT REALLY :-)

Page 26: Continuous Delivery

#REDEFINE DONE

Page 27: Continuous Delivery

NOT READY TILL DEPLOYED

Page 28: Continuous Delivery

DONE === RELEASED

Page 29: Continuous Delivery

build&

deploy&

measure&

data&

learn&

ideas&

ERIC RIES, THE LEAN STARTUP

Page 30: Continuous Delivery

If we can reduce the time between major iterations

we can increase our odds of successEric Ries, Lean Startup

Page 31: Continuous Delivery

RELEASESgive us

Page 32: Continuous Delivery

FEEDBACK!

Page 33: Continuous Delivery

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

Page 34: Continuous Delivery

RELEASE == FEEDBACK

Page 35: Continuous Delivery

REPEATABLE FEEDBACK

Page 36: Continuous Delivery

HOW?!

Page 37: Continuous Delivery

THE DEPLOYMENT PIPELINEentreth:

Page 38: Continuous Delivery

THE DEPLOYMENT PIPELINE

Page 39: Continuous Delivery

THE DEPLOYMENT PIPELINE

compile

Page 40: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

Page 41: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Page 42: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

artifact repository

Page 43: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

artifact repository

Page 44: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

artifact repository

Page 45: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing

artifact repository

Page 46: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing Release

artifact repository

Page 47: Continuous Delivery

BUILD ONLY ONCE!

Page 48: Continuous Delivery

THE DEPLOYMENT PIPELINE

Page 49: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

artifact repository

Page 50: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing

artifact repository

Page 51: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing Release

artifact repository

Page 52: Continuous Delivery

THE DEPLOYMENT PIPELINE

Page 53: Continuous Delivery

THE DEPLOYMENT PIPELINE

Acceptance testing

Capacity testing

Page 54: Continuous Delivery

THE DEPLOYMENT PIPELINE

Acceptance testing

Capacity testing

Manual testing

Page 55: Continuous Delivery

THE DEPLOYMENT PIPELINE

Acceptance testing

Capacity testing

Manual testing Release

Page 56: Continuous Delivery

THE DEPLOYMENT PIPELINE

unit testcompile

package

Acceptance testing

Capacity testing

Manual testing Release

artifact repository

fear!

Page 57: Continuous Delivery

AUTOMATE EVERYTHING!(almost)

Page 58: Continuous Delivery

AUTOMATE EVERYTHING!

Page 59: Continuous Delivery

AND?

Page 60: Continuous Delivery

WELL, IT’S BIG

Page 61: Continuous Delivery

ALL CODE IS PRODUCTION READY

Page 62: Continuous Delivery

EVERY VERSION IS A RELEASE CANDIDATE

Page 63: Continuous Delivery

QUALITY GOES UPpeople care

Page 65: Continuous Delivery

PRO TIP: --VERSION

Page 66: Continuous Delivery

WHY VERSIONS?

Page 67: Continuous Delivery

185.0.1is more friendly than

0cdfc45df874354265b3be910b52c41398de79ca

Page 68: Continuous Delivery

ANTIPATTERNS

Page 69: Continuous Delivery

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

Page 70: Continuous Delivery
Page 71: Continuous Delivery

LATE FIRST CONTACT WITH REALITY

Page 72: Continuous Delivery

UNREALISTIC ASSUMPTIONS

Page 73: Continuous Delivery

WELL TESTED IN.. DEV

Page 74: Continuous Delivery

DEPLOYING MANUALLYis evil!

Page 75: Continuous Delivery

ERROR-PRONE

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

Page 76: Continuous Delivery

ALWAYS DIFFERENTrepeatable

Page 77: Continuous Delivery

IMPOSSIBLE TO TEST

Page 80: Continuous Delivery

THE “DEPLOY” TEAM

Page 81: Continuous Delivery

DO YOU AVOID DEPLOYS?

Page 82: Continuous Delivery

HOW OFTEN DO YOU DEPLOY?

Page 83: Continuous Delivery

IF IT HURTSDO IT MORE OFTEN!

practice, practice, practice

Page 84: Continuous Delivery

INCREMENTAL, FREQUENT RELEASES REDUCE RISK

Page 85: Continuous Delivery

PROVIDE DATA

Page 86: Continuous Delivery

GIVE ROLLBACK POINTS

Page 87: Continuous Delivery

SOME STATS

Facebook - every 10 minutes

Etsy - 50-60 deploys/day

GitHub - >50 deploys/day

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

Page 88: Continuous Delivery

ENVIRONMENTS

Page 89: Continuous Delivery

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

TO BE BACK UP?

Page 90: Continuous Delivery

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

Page 91: Continuous Delivery

IMAGINE:

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

Page 92: Continuous Delivery

INFRASTRUCTURE AND CONFIGURATION IS JUST AS IMPORTANT

Page 93: Continuous Delivery

VERSION IT!(puppet, chef, etc)

Page 94: Continuous Delivery

BEFRIEND SOME ADMINS :-)

Page 95: Continuous Delivery

AND VERSION EVERYTHING

Page 96: Continuous Delivery

MANUAL CONFIGURATION OF ENVIRONMENTS

Page 97: Continuous Delivery

PRIVILEGED DEPLOY TEAM

Page 98: Continuous Delivery

NOT REPEATABLE

Page 99: Continuous Delivery

SLIGHT DIFFRENENCES

Page 100: Continuous Delivery

DOESN’T SCALE

Page 101: Continuous Delivery

HARD TO TRACK

Page 102: Continuous Delivery

ROLLBACK, ANYONE?

Page 103: Continuous Delivery

TRUCKS

Page 104: Continuous Delivery
Page 105: Continuous Delivery

MEANWHILE, IN THE REAL WORLD

Page 106: Continuous Delivery

MY SYSTEM IS ***

Page 107: Continuous Delivery

WHERE TO START?

Page 108: Continuous Delivery

WITH PRODUCTIONand fix things backwards

Page 109: Continuous Delivery

AUTOMATE DEVELOPMENTand bring automation forward

Page 110: Continuous Delivery

DEPLOYShow do I?

Page 111: Continuous Delivery

DEPLOYS

• blue-green

• canary

• emergency fixes

Page 112: Continuous Delivery

BLUEGREEN

traffic

Page 113: Continuous Delivery

FULL BLUEGREEN IS COSTLYbut great for availability

Page 114: Continuous Delivery

CANARY

old old old

newold old old

new

Page 115: Continuous Delivery

EMERGENCY FIXES

Page 116: Continuous Delivery

EMERGENCY FIXESgo the same way

Page 117: Continuous Delivery

DON’T BREAK RULES

Page 118: Continuous Delivery
Page 119: Continuous Delivery

CAVEATS!

Page 120: Continuous Delivery

STATE

Page 121: Continuous Delivery

LONG RUNNING *

Page 127: Continuous Delivery

MAYBE EVENT SOURCING?

Page 128: Continuous Delivery

VERSION YOUR ENTITIESand code accordingly

Page 129: Continuous Delivery

BRANCHING

Page 130: Continuous Delivery
Page 132: Continuous Delivery

if your system looks like that

Page 133: Continuous Delivery

CUT!

Page 134: Continuous Delivery
Page 135: Continuous Delivery

• have integration tests

• have a “test” system

Page 136: Continuous Delivery

DESKTOPS

• LOVE your autoupdate

• build-in version checking and inform user

Page 137: Continuous Delivery

DESKTOPS

Do or

Page 138: Continuous Delivery

LOVE YOUR AUTOUPDATE

Page 139: Continuous Delivery

PUSH USER UP

Page 140: Continuous Delivery

IN PRACTICE

Page 141: Continuous Delivery

MODULES^N

Page 142: Continuous Delivery

PRE-TESTED COMMITSrock, a bit

Page 143: Continuous Delivery

DVCSrock, a lot!

Page 144: Continuous Delivery

VMSrock a lot!

Page 145: Continuous Delivery

THERE ARE TOOLS

Page 146: Continuous Delivery

IS AWESOMEbut

Page 147: Continuous Delivery
Page 148: Continuous Delivery

+

Page 149: Continuous Delivery

GLUhttp://linkedin.github.com/glu

Page 150: Continuous Delivery
Page 151: Continuous Delivery

GO ($$$)

Page 152: Continuous Delivery

PALDIES!kthxbye!

Page 154: Continuous Delivery

RESOURCES

• http://continuousdelivery.com

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