a pragmatic approach to continuous delivery

36
A Pragmatic Approach to Continuous Delivery Ivar Grimstad jDays 2012 Ivar Grimstad 1

Upload: ivar-grimstad

Post on 05-Jul-2015

1.847 views

Category:

Technology


0 download

DESCRIPTION

Here are the slides from my presentation at jDays 2012.

TRANSCRIPT

Page 1: A pragmatic approach to continuous delivery

A Pragmatic Approach to Continuous DeliveryIvar Grimstad

jDays 2012 Ivar Grimstad1

Page 2: A pragmatic approach to continuous delivery

2012-12-03 e.g. name of the presenter2

Page 3: A pragmatic approach to continuous delivery

@ivar_grimstad

jDays 2012 Ivar Grimstad3

Page 4: A pragmatic approach to continuous delivery

• JUnit

• Ant

• Continuous Integration

• Maven

• Continuous Delivery

A Little History

jDays 2012 Ivar Grimstad4

Page 5: A pragmatic approach to continuous delivery

Individuals and interactions over processes and tools

Working software over comprehensive documentation

Customer collaboration over contract negotiation

Responding to change over following a plan

Agile Manifesto

jDays 2012 Ivar Grimstad5

http://www.agilemanifesto.org/

Page 6: A pragmatic approach to continuous delivery

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

team is face-to-face conversation.

Working software is the primary measure of progress.

Agile processes promote sustainable development.

The sponsors, developers, and users should be able

to maintain a constant pace indefinitely.

Continuous attention to technical excellence

and good design enhances agility.

Simplicity--the art of maximizing the amount

of work not done--is essential.

The best architectures, requirements, and designs

emerge from self-organizing teams.

At regular intervals, the team reflects on how

to become more effective, then tunes and adjusts

its behavior accordingly.

Principles behind the Agile Manifesto

jDays 2012 Ivar Grimstad6

http://www.agilemanifesto.org/

Page 7: A pragmatic approach to continuous delivery

Our highest priority is to satisfy the customer

through early and continuous delivery of valuable

software.

Principles behind the Agile Manifesto

jDays 2012 Ivar Grimstad7

http://www.agilemanifesto.org/

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

team is face-to-face conversation.

Working software is the primary measure of progress.

Agile processes promote sustainable development.

The sponsors, developers, and users should be able

to maintain a constant pace indefinitely.

Continuous attention to technical excellence

and good design enhances agility.

Simplicity--the art of maximizing the amount

Page 8: A pragmatic approach to continuous delivery

A Pragmatic Approach to Continuous Delivery

Motivation

jDays 2012 Ivar Grimstad8

Page 9: A pragmatic approach to continuous delivery

• Build Binaries Once

• One Process Deploy

• Test Deployments

• Flow

• Fail -> Stop the Line

The Deployment Pipeline

jDays 2012 Ivar Grimstad9

Page 10: A pragmatic approach to continuous delivery

• Commit

• Analysis

• Deploy

• Test

• Deliver

Remember that this is a pragmatic approach

Deployment Pipeline Stages

jDays 2012 Ivar Grimstad10

Page 11: A pragmatic approach to continuous delivery

• Compile

• Test

• Create binaries for later use

The Commit Stage - Steps

jDays 2012 Ivar Grimstad11

Page 12: A pragmatic approach to continuous delivery

The Commit Stage - Example

jDays 2012 Ivar Grimstad12

Page 13: A pragmatic approach to continuous delivery

• Static Analysis

The Analysis Stage - Steps

jDays 2012 Ivar Grimstad13

Page 14: A pragmatic approach to continuous delivery

• Test Coverage

• Duplications

• Complexity

• Coupling

• Rule Compliance

• Code Style

The Analysis Stage - Metrics

jDays 2012 Ivar Grimstad14

Page 15: A pragmatic approach to continuous delivery

Sonar

jDays 2012 Ivar Grimstad15

Page 16: A pragmatic approach to continuous delivery

The Analysis Stage - Example

jDays 2012 Ivar Grimstad16

Page 17: A pragmatic approach to continuous delivery

• Copy Artifact from Commit Stage

• Deploy to Test Environment

The Deploy Stage - Steps

jDays 2012 Ivar Grimstad17

Page 18: A pragmatic approach to continuous delivery

The Deploy Stage - Example

jDays 2012 Ivar Grimstad18

Page 19: A pragmatic approach to continuous delivery

• Choose a subset of tests to run

• Run tests most likely to fail first

The Test Stage - Steps

jDays 2012 Ivar Grimstad19

Page 20: A pragmatic approach to continuous delivery

The Test Stage - Example

jDays 2012 Ivar Grimstad20

Page 21: A pragmatic approach to continuous delivery

The Test Stage - Example

jDays 2012 Ivar Grimstad21

Page 22: A pragmatic approach to continuous delivery

• Copy Artifact from Commit Stage

• Deliver according to agreement

The Deliver Stage - Steps

jDays 2012 Ivar Grimstad22

Page 23: A pragmatic approach to continuous delivery

The Deliver Stage - Example

jDays 2012 Ivar Grimstad23

Page 24: A pragmatic approach to continuous delivery

Jenkins Build Pipeline Plugin

jDays 2012 Ivar Grimstad24

Page 25: A pragmatic approach to continuous delivery

Jenkins Build Pipeline Plugin

jDays 2012 Ivar Grimstad25

Page 26: A pragmatic approach to continuous delivery

• Use Maven Release Plugin

– mvn release:branch or mvn release:prepare

– mvn release:perform

• Jenkins Fingerprint Functionality

What about Versioning?

jDays 2012 Ivar Grimstad26

Page 27: A pragmatic approach to continuous delivery

Do not underestimate JavaDoc!

What about Documentation?

jDays 2012 Ivar Grimstad27

Page 28: A pragmatic approach to continuous delivery

• Blue/Green Deployments

• Canary Releasing

• Feature Toggles

• Branch by Abstraction

Designing for Continuous Delivery

jDays 2012 Ivar Grimstad28

Page 29: A pragmatic approach to continuous delivery

• Manual Deployment

• Deployment to production-like environment after

development is complete

• Manual configuration of production environment

• Excessive Branching

Antipatterns

jDays 2012 Ivar Grimstad29

Page 30: A pragmatic approach to continuous delivery

• Every change should trigger the feedback process

• Fast Feedback

• Act on the Feedback

To Sum Up

jDays 2012 Ivar Grimstad30

Page 31: A pragmatic approach to continuous delivery

• Jenkins

– Build Pipeline Plugin

– Copy Artifact Plugin

• Sonar

• Maven

– Maven Release Plugin

– Maven Javadoc Plugin

– Maven Glassfish Plugin (similar for all app servers)

Tools

jDays 2012 Ivar Grimstad31

Page 32: A pragmatic approach to continuous delivery

• Define your pipeline steps

• Set up the jobs

• Start configuring

• Evolve your pipeline

Where to start?

jDays 2012 Ivar Grimstad32

Page 33: A pragmatic approach to continuous delivery

• Architecting for Continuous Delivery

Axel Fontaine

Tuesday 14:40

• Building a Continuous Deployment Pipeline with Maven

Alan Parkinson

Wednesday 13:30

More at jDays

jDays 2012 Ivar Grimstad33

Page 34: A pragmatic approach to continuous delivery

It is not that hard!

Remember…

jDays 2012 Ivar Grimstad34

Page 35: A pragmatic approach to continuous delivery

You’re probably doing it already!

…and

jDays 2012 Ivar Grimstad35

Page 36: A pragmatic approach to continuous delivery

@ivar_grimstad

http://www.agilejava.eu

jDays 2012 Ivar Grimstad36