Top Banner
© 2015 CloudBees, Inc. All Rights Reserved © 2015 CloudBees, Inc. All Rights Reserved Continuous Delivery with Jenkins Jenkins Solutions to Implement Continuous Delivery Valentina Armenise
22

Continuous Delivery With Jenkins

Jul 28, 2015

Download

Engineering

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

201

5 Cl

oudB

ees,

Inc.

All

Righ

ts R

eser

ved

Continuous Delivery with JenkinsJenkins Solutions to Implement Continuous Delivery

Valentina Armenise

Page 2: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Me

2

http://varmenise.tumblr.com/

Linkedin

https://github.com/varmenise

• 2 years as Java Developer at Open Reply

• 1 year as Developer Success Engineer at CloudBees

• 1 year as SA at CloudBees

• NOW: Software Engineer at Cloudbees

Page 3: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

About CloudBees

3

Who are we? CloudBees is the premier provider of Jenkins Continuous Integration services and support

What do we do with Jenkins?

CloudBees optimizes Jenkins for the enterprise

• Jenkins Operations Center• Jenkins OSS Support• Enterprise-class plugins• Commit code and support the Jenkins Community• Jenkins training and consulting• Jenkins User Conferences (JUC) and newsletters

Page 4: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Outline

• Continuous Integration (CI)o CI with Jenkins

• Continuous Delivery (CD)o CD with Jenkins

• Jenkins: the Workflow Plugin

• Jenkins: traceability with Puppet/Chefo The Notification Plugin

• Open Challenges

• Summary4

Page 5: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Continous Integration

• The Time To Market critically affects the success of a product

• The traditional Waterfall model was too slow and did not easily apply to the reality

• The Agile revolution encouraged:

o Rapid response to changeso Collaboration across teams

5

Page 6: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Continuous Integration

• The Concept of Continuous Integration was a first step that significantly sped up the product lifecycle

o Frequent commitso Frequent integrationso Easy detection of problems right after a bad

commito No necessity to back-tracko Reduction of the integration timeo Increase of productivity

6

Page 7: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Jenkins & CI

• Born as hobby project of K.Kawaguchi

• Born with two main objectives:o Automation of the build o Automation of the test process

• Completely written in java:o https://github.com/jenkinsci/jenkinso https://jenkins.ci.cloudbees.com/

• Most used CI toolo Plugin architecture o OSS natureo Elasticity and Flexibility

7

Page 8: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Jenkins installations

8

>100 000

Page 9: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

From Continuous Integration to Continuous Delivery• If Continuous Integration (CI) started as

automation of the development-phase only, pretty soon the revolution embraced:

o The test-phase (QA team)o The deployment-phase (Ops team)

• Continuous Delivery (CD) was the natural extension of CI, advocating:

o Collaboration across all the teams involved in the product life-cycle

o Extensive automation of the delivery process

9

Page 10: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Jenkins & CD

• Implementing CD means:

o Being able to chain different steps of a cross-team pipeline

o Automate their execution

• Jenkins is the Hub of CD

10

Page 11: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Continuous Delivery

11

Page 12: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Implementing CD with Jenkins

• Jenkins aligned to the new concept thanks to plugins able to:

o Chain jobs together

o Promote the execution of jobs

o Allow human manual intervention

o Monitor the execution through WUI

o Monitor the result of the execution

12

Page 13: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Implementing CD with Jenkins

• Plugins:

– Build Flow Plugin

– Build Pipeline Plugin

– Build Delivery Pipeline

– …

13

Page 14: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Implementing CD with Jenkins: the Problem

• Choose the right plugins

• Combine several plugins to obtain different functionalities

• Many atomic jobs chained together

14

Page 15: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Implementing CD with Jenkins: Workflow

• A single plugin to implement:

– Complex pipelines involving multiple stages

– Not-sequential logic such as loops, forks ..

– Long running builds must survive outages

– Interaction with humans including pauses, input

– Restartable builds in case of transient errors

– Reusable definition to avoid duplication

– Comprehensible scripts with one clear definition

15

Page 16: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

16

Workflow Groovy Script

Parallel steps

Restartability:checkpoints

Manual intervention

Page 17: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

17

Workflow Stage View

Page 18: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Jenkins and Chef/Puppet Traceability

• Jenkins integrates with Puppet/Chef:

o The Puppet Master/Chef Server will ensure that the managed server are configured properly before deploying the artifacts

• When deploying, the traceability is lost:

o Where does the artifact come from?o Which was the build that generated the

artifact?

• Traceability is where the integration between Jenkins and Puppet/Chef brings value:

o Notification Plugin18

Page 19: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

19

Traceability in Action

Page 20: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Open Challenges

• How to do versioning of artifacts that must be continuously shippable?

o CD nullifies the concept of intermediate versions

• How to trace the environment in which the artifact was created?

o Today there is no way to capture the environment used to generate the artifact

20

Page 21: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Summary

• Jenkins was extended to impersonate the role of orchestrator in the product lifecycle

• The need of managing the whole CD pipeline required the implementation of new features:

o Workflow Plugino Notification Plugin

• Further steps need to be taken in order to make Jenkins able to fully embrace the CD revolution:

o Lack of best practices for versioning continuously shippable artifacts

o Lack of best practices for tracing the build environment

21

Page 22: Continuous Delivery With Jenkins

© 2

015

Clou

dBee

s, In

c. A

ll Ri

ghts

Res

erve

d

Questions?

22