a pragmatic approach to continuous delivery
DESCRIPTION
Here are the slides from my presentation at jDays 2012.TRANSCRIPT
A Pragmatic Approach to Continuous DeliveryIvar Grimstad
jDays 2012 Ivar Grimstad1
2012-12-03 e.g. name of the presenter2
@ivar_grimstad
jDays 2012 Ivar Grimstad3
• JUnit
• Ant
• Continuous Integration
• Maven
• Continuous Delivery
A Little History
jDays 2012 Ivar Grimstad4
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/
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/
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
A Pragmatic Approach to Continuous Delivery
Motivation
jDays 2012 Ivar Grimstad8
• Build Binaries Once
• One Process Deploy
• Test Deployments
• Flow
• Fail -> Stop the Line
The Deployment Pipeline
jDays 2012 Ivar Grimstad9
• Commit
• Analysis
• Deploy
• Test
• Deliver
Remember that this is a pragmatic approach
Deployment Pipeline Stages
jDays 2012 Ivar Grimstad10
• Compile
• Test
• Create binaries for later use
The Commit Stage - Steps
jDays 2012 Ivar Grimstad11
The Commit Stage - Example
jDays 2012 Ivar Grimstad12
• Static Analysis
The Analysis Stage - Steps
jDays 2012 Ivar Grimstad13
• Test Coverage
• Duplications
• Complexity
• Coupling
• Rule Compliance
• Code Style
The Analysis Stage - Metrics
jDays 2012 Ivar Grimstad14
Sonar
jDays 2012 Ivar Grimstad15
The Analysis Stage - Example
jDays 2012 Ivar Grimstad16
• Copy Artifact from Commit Stage
• Deploy to Test Environment
The Deploy Stage - Steps
jDays 2012 Ivar Grimstad17
The Deploy Stage - Example
jDays 2012 Ivar Grimstad18
• Choose a subset of tests to run
• Run tests most likely to fail first
The Test Stage - Steps
jDays 2012 Ivar Grimstad19
The Test Stage - Example
jDays 2012 Ivar Grimstad20
The Test Stage - Example
jDays 2012 Ivar Grimstad21
• Copy Artifact from Commit Stage
• Deliver according to agreement
The Deliver Stage - Steps
jDays 2012 Ivar Grimstad22
The Deliver Stage - Example
jDays 2012 Ivar Grimstad23
Jenkins Build Pipeline Plugin
jDays 2012 Ivar Grimstad24
Jenkins Build Pipeline Plugin
jDays 2012 Ivar Grimstad25
• Use Maven Release Plugin
– mvn release:branch or mvn release:prepare
– mvn release:perform
• Jenkins Fingerprint Functionality
What about Versioning?
jDays 2012 Ivar Grimstad26
Do not underestimate JavaDoc!
What about Documentation?
jDays 2012 Ivar Grimstad27
• Blue/Green Deployments
• Canary Releasing
• Feature Toggles
• Branch by Abstraction
Designing for Continuous Delivery
jDays 2012 Ivar Grimstad28
• Manual Deployment
• Deployment to production-like environment after
development is complete
• Manual configuration of production environment
• Excessive Branching
Antipatterns
jDays 2012 Ivar Grimstad29
• Every change should trigger the feedback process
• Fast Feedback
• Act on the Feedback
To Sum Up
jDays 2012 Ivar Grimstad30
• 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
• Define your pipeline steps
• Set up the jobs
• Start configuring
• Evolve your pipeline
Where to start?
jDays 2012 Ivar Grimstad32
• 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
It is not that hard!
Remember…
jDays 2012 Ivar Grimstad34
You’re probably doing it already!
…and
jDays 2012 Ivar Grimstad35
@ivar_grimstad
http://www.agilejava.eu
jDays 2012 Ivar Grimstad36