38
How do you implement Continuous Delivery? Part 3: All about Pipelines

How do you implement Continuous Delivery? Part 3: All about Pipelines

Embed Size (px)

DESCRIPTION

In Part 3 of our series on putting CD into practice, we explore setting up a pipeline for progressive testing and various pipeline design patterns.

Citation preview

Page 1: How do you implement Continuous Delivery? Part 3: All about Pipelines

How do you implement

Continuous Delivery?

Part 3: All about Pipelines

Page 2: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline for

progressive testing

Page 3: How do you implement Continuous Delivery? Part 3: All about Pipelines

With CD, every build is a release candidate Pipeline for progressive testing

þ þ ý ý þ þ ý þ þ

Page 4: How do you implement Continuous Delivery? Part 3: All about Pipelines

The Testing Pyramid

Pipeline for progressive testing

Faster Feedback

Broader Scope

Page 5: How do you implement Continuous Delivery? Part 3: All about Pipelines

The Testing Pyramid

Pipeline for progressive testing

The Delivery Pipeline

Faster Feedback

Broader Scope

Faster Feedback

Increasing Confidence

Page 6: How do you implement Continuous Delivery? Part 3: All about Pipelines

The system being developed Pipeline for progressive testing

Other Services

Application A

Application B

Page 7: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline for progressive testing

Unit Tests

Each unit test covers one app component

Other components are stubbed

Page 8: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline for progressive testing

The first stage of the pipeline runs the unit tests

Unit Tests

Page 9: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline for progressive testing

Integration Tests

Integration tests cover a group of related components within the application

Page 10: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline for progressive testing

Application Tests

Application tests cover an application running in a container, mocking connections to other applications

Page 11: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline for progressive testing

System Tests

System tests cover the set of applications developed by the team, running together, mocking connections to external services

Page 12: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline for progressive testing

System Integration

Tests

Systems integration tests exercise all parts of the system, including external dependencies

Page 13: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline

Design Patterns

Page 14: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Application Pipeline

Automated tests

Automated tests

Automated tests

Tested Build

Manual tests Live

Unattended Process

One-click deployments

Typical Pipeline Stages

Page 15: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Commit Stage

Commit Stage

1.  Developer commits code to SCM

Typical Pipeline Stages

Page 16: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Commit Stage

Commit Stage

1.  Developer commits code to SCM

2.  Build server checks out & compiles code

Typical Pipeline Stages

Page 17: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Commit Stage

Commit Stage

1.  Developer commits code to SCM

2.  Build server checks out & compiles code

3.  Unit tests

Typical Pipeline Stages

Page 18: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Commit Stage

Commit Stage

1.  Developer commits code to SCM

2.  Build server checks out & compiles code

3.  Unit tests

4.  Code analysis

Typical Pipeline Stages

Page 19: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Commit Stage

Commit Stage

1.  Developer commits code to SCM

2.  Build server checks out & compiles code

3.  Unit tests

4.  Code analysis

5.  Create build artefact

Typical Pipeline Stages

Page 20: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Deployment Testing Stage

Deployment Testing Stage

1.  Prepare environment

Typical Pipeline Stages

Page 21: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Deployment Testing Stage

Deployment Testing Stage

1.  Prepare environment

2.  Retrieve artefact

Typical Pipeline Stages

Page 22: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Deployment Testing Stage

Deployment Testing Stage

1.  Prepare environment

2.  Retrieve artefact

3.  Deploy

Typical Pipeline Stages

Page 23: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Deployment Testing Stage

Deployment Testing Stage

1.  Prepare environment

2.  Retrieve artefact

3.  Deploy

4.  Smoke Test

Page 24: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Typical Deployment Testing Stage

Deployment Testing Stage

1.  Prepare environment

2.  Retrieve artefact

3.  Deploy

4.  Smoke Test

5.  Automated UI tests

Typical Pipeline Stages

Page 25: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Other pipeline stages

q  Performance testing

q  Security testing

q  Exploratory testing

q  User acceptance testing

Typical Pipeline Stages

Page 26: How do you implement Continuous Delivery? Part 3: All about Pipelines

Best practices for pipeline stages

Keep everything in source control

Only build artefacts once

Replicate production constraints

Deploy the same way every time

Pipeline Design Patterns

Typical Pipeline Stages

Keep it simple, implement only those stages that make sense for your system

Page 27: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Build Progression

þ þ þ r101

Typical Pipeline Stages

Pipeline Progression

Page 28: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Build Progression

þ þ þ r101 ý

If tests fail, work stops until the issue is resolved

Typical Pipeline Stages

Pipeline Progression

Page 29: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Build Progression

þ þ þ r101 ý

The fix is committed, and a new build goes through the pipeline from the

beginning

þ þ r102 þ þ Typical Pipeline Stages

Pipeline Progression

Page 30: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Build Progression

þ þ þ r101 ý

Multiple builds may go through test without being deployed to production

þ þ r102 þ þ þ þ r103 þ þ

Typical Pipeline Stages

Pipeline Progression

Page 31: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Build Progression

þ þ þ r101 ý

Deployment to Production

þ þ r102 þ þ þ þ r103 þ þ þ þ r104 þ þ þ þ

Typical Pipeline Stages

Pipeline Progression

Page 32: How do you implement Continuous Delivery? Part 3: All about Pipelines

Joining multiple applications Pipeline Design Patterns

Application A

Application B

Typical Pipeline Stages

Pipeline Progression

Joining multiple applications

Page 33: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Application A

Application B

Application Testing Complete

Application Testing Complete

Joining multiple applications

Typical Pipeline Stages

Pipeline Progression

Joining multiple applications

Page 34: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Application A

Application B

Application Testing Complete

Application Testing Complete

Integration Testing

Joining multiple applications

If tests fail for application A, application B can still proceed

using the last “good” version of A

Typical Pipeline Stages

Pipeline Progression

Joining multiple applications

LIVE

Page 35: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Provider

Consumer

Federated Pipelines

Pre-release testing

Typical Pipeline Stages

Pipeline Progression

Joining multiple applications

Provider team could host instances for testing…

Page 36: How do you implement Continuous Delivery? Part 3: All about Pipelines

Pipeline Design Patterns

Provider

Consumer

Federated Pipelines

Pre-release testing LIVE

Consumer contract tests

…or provide packages for deployment by the Consumer team Typical Pipeline Stages

Pipeline Progression

Joining multiple applications

Provider team could host instances for testing…

Page 37: How do you implement Continuous Delivery? Part 3: All about Pipelines

Automated Testing

Stay tuned for Part 4…

Page 38: How do you implement Continuous Delivery? Part 3: All about Pipelines

Deploy a great product faster. Agile teams deliver working software early and often. Go automates and streamlines the build-test-release cycle for worry-free, continuous delivery of your product.

Learn More See how Go can help you in your CD journey

goContinuous Delivery