36
AW7 Agile Development Concurrent Session 11/12/2014 1:30 PM "Continuous Delivery: Never Send a Human to Do a Machine’s Job" Presented by: Steve Povilaitis LeadingAgile, LLC Brought to you by: 340 Corporate Way, Suite 300, Orange Park, FL 32073 888-268-8770 ∙ 904-278-0524 ∙ [email protected] ∙ www.sqe.com

Continuous Delivery: Never Send a Human to Do a Machine’s Job

Embed Size (px)

Citation preview

AW7 Agile Development Concurrent Session 11/12/2014 1:30 PM

"Continuous Delivery: Never Send a Human to Do a Machine’s

Job"

Presented by:

Steve Povilaitis LeadingAgile, LLC

Brought to you by:

340 Corporate Way, Suite 300, Orange Park, FL 32073 888-268-8770 ∙ 904-278-0524 ∙ [email protected] ∙ www.sqe.com

Steve Povilaitis has successfully led agile adoption, engineering, and release management across a broad spectrum of organizations from Internet startups to large-scale enterprise programs. Steve focuses his efforts on integrating Scrum and kanban with XP engineering practices. He has been a decades-long advocate of operational and technical agility, honing his agile mindset as an Army communications officer and paratrooper responsible for planning and delivering military telecommunications capabilities in a highly dynamic and complex environment. When Steve’s not helping his teams navigate the agile waters, you'll find him surfing the calmer seas around his hometown of New Smyrna Beach, Florida.

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Continuous Deployment

Continuous Delivery as a Competitive Advantage Steve Povilaitis

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Steve Povilaitis Enterprise Agile Coach

[email protected] •386.690.3118

•www.leadingagile.com •twitter.com/stevepov •facebook.com/leadingagile •linkedin.com/in/stevepov

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Overview

Introduction to Continuous Deployment CD workflow and practices Tools Example Continuous Deployment architecture

Luck is not a factor. Hope is not a strategy. Fear is not an option.

What is Continuous Deployment?

Luck is not a factor. Hope is not a strategy. Fear is not an option.

How long would it take your organization to deploy a change [to production] that involves just one single line of code? Do you do this on a repeatable, reliable basis? - Mary and Tom Poppendieck, Implementing Lean Software

Development

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Luck is not a factor. Hope is not a strategy. Fear is not an option.

What is Continuous Deployment?

• A development methodology • Of continuous developer integrations/deployments • Executed by automatic builds

Watch

Build

Test

Publish

Luck is not a factor. Hope is not a strategy. Fear is not an option.

What is it not?

• Nightly Builds • Developer branches • Scheduled Integration Points • Building via IDEs

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Integration is Hard!

• Software Effort increases exponentially vs: – Bug Count – Number of components – Time since last integration

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Reduce Risk of Change

John Allspaw, Ops Meta-Metrics

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Scrum provides an agile process for Early Value Delivery

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Traditional Process Risks • Lack of Team Cohesion

– “Your changes to Foobar are incompatible with mine. How do we merge now?”

– “I thought you fixed that XX days/weeks/months ago!” • Poor quality code base

– “Why can’t I just include Foo and not require all of the other libs?”

• Lack of project visibility – “What do you mean the tests are failing?” – “What’s in version 1.2.3. of the build?” – “What’s our code coverage right now?”

• Lack of deployable software – “It works on my machine!” – “The customer is coming, we need to demo today”

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Use CD to Reduce Risk and Improve Quality • Better

– Test early and often with self-testing builds – Developers concentrate on coding, repetitive and boring tasks

like testing are automated • Faster

– Replace big and long integration phases with small and frequent ones

– Build, Test, Deploy in parallel, not at the end – No integration points mean builds and deployments become a

non-event! • Cheaper

– Identify defects earlier – Fix when least costly – Easily repeatable build, test, and deploy process

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Continuous Integration Workflow

• Monitor source repository for changes

• Checkout source whenever there are ANY changes

• Ensure code actually compiles on every target platform

• Run unit and integration tests • Generate documentation • Package and deploy

Watch

Build

Test

Publish

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Automated Build Process

SCM

Build Results Test Results

Doxygen output

Email/Web/IM

1. Bootstrap

2. Check for modifications 3. Get the revision log

Jenkins

Javac ant

Junit Doxygen

etc

4.2 Run Build

5. Publish Artifacts

6. Send to publisher

4.1. Get the latest source

4.3. Tag source (optional)

Jenkins SCM adapter

4. Run Build

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Compilation != A Build

Build Inputs • Sources

– .java .js

• Configuration files – XML files – Properties

• Resources – Libraries

Build Outputs Executable / Library Test Results Junit

Documentation doxygen

Installers

Source Package

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Builds are Self Testing

• Directly go from source to running xUnit tests – No manual copying – No configuration file

editing

Watch

Build

Test

Publish

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Automatic Build and Test Reporting

• Automatic publishing of – Build results – xUnit test results

• Everyone Sees what’s happening – Web interface – Notifications via

• Email • IM • RSS

Watch

Build

Test

Publish

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Key Components

• Source Control

• Test Driven Development • Behavior Driven Development • Automated Testing

• Continuous Integration

• Infrastructure as Code

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Source Control

• Essential for development teams to work effectively on the same code base

• Ability to attach historical data to code, such as

• Explanatory comments about the intent behind each change

• Control the “production line” with commit hooks

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Source Control Recommendability

http://martinfowler.com/bliki/VersionControlTools.html

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Test Driven Development

• Red, Green, Refactor • Permanent Regression • Self Documentation • More Maintainable Code

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Behavior Driven Development

• Starts with a conversation • Shared understanding of the features to

be implemented • Features are identified as user stories

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Automated Testing

• Unit Testing

• Functional Testing • Performance Testing

• Stress Testing

• Security Testing

• Disaster Recovery Testing

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Infrastructure as Code

• Automate the process of bringing the system to a working state

• Production like environments can be

built from scratch in minutes

• Versioning environments along with applications allows for continuous testing of our infrastructure

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Tools • Application Lifecycle Management (ALM)

– VersionOne, Rally, Mingle, Trac • CI/Build Server

– Bamboo, Hudson, Jenkins, TeamCity, Electric Commander

• Source Control – Mercurial, Git, Subversion

• Automated Testing – jUnit, Nunit, RSpec, Cucumber, Fitnesse, Selenium

• Infrastructure as Code – Puppet, Chef

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Jenkins CI Server + Trac

• Jenkins: Open Source, written in Java

• Trac: Open Source, written in Python

• No install required – Runs within a web

container • Web based

configuration • Support for

– Subversion – NAnt – NUnit – FXCop

Watch

Build

Test

Publish

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Martin Fowler’s 10 Practices for CI Maintain a Single Source Repository. Automate the Build Make Your Build Self-Testing Everyone Commits Every Day Every Commit Should Build the Mainline on an Integration Machine Keep the Build Fast Test in a Clone of the Production Environment Make it Easy for Anyone to Get the Latest Executable Everyone can see what's happening Automate Deployment

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Summary

Continuous Deployment can help us build better quality software faster, with more

confidence

Let’s use it!

Luck is not a factor. Hope is not a strategy. Fear is not an option.

Steve Povilaitis Enterprise Agile Coach

[email protected] •386.690.3118

•www.leadingagile.com •twitter.com/stevepov •facebook.com/leadingagile •linkedin.com/in/stevepov