continuous integration, continuous delivery & continuous · 2018-10-10 · in contrast to...

31

Upload: others

Post on 22-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline
Page 2: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

Continuous Integration, Continuous Delivery & Continuous Deployment

Continuous Integration — the practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.

Continuous Delivery — a software development discipline where you build software in such a way that the software can be released to production at any time.

Continuous Deployment — releasing every good build to users.

2

Page 3: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

3

Page 4: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

4

Let’s configure!

Page 5: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

5

Configure Jenkins job to trigger build on branch changeJenkins - Global Tool Configuration

Page 6: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

6

Configure Jenkins job to trigger build on branch changeJenkins - Global Tool Configuration

Page 7: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

Configure Jenkins job to trigger build on branch change

7

Install Bitbucket Plugin for Jenkinshttps://wiki.jenkins.io/display/JENKINS/BitBucket+Plugin

Page 8: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

Configure Jenkins job to trigger build on branch change

8

Page 9: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

Configure Jenkins job to trigger build on branch change

9

Jenkins – New Item – Freestyle Project

Page 10: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

10

Page 11: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

11

Page 12: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

12

Page 13: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

13

Configure Jenkins job to check PR’s in BitbucketJenkins – New Item – Freestyle Project

Page 14: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

14

Configure Jenkins job to check PR’s in Bitbucket

Page 15: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

15

Configure Jenkins job to check PR’s in Bitbucket

Configure Bitbucket

Install Pull Request Notifier for Bitbucket

https://marketplace.atlassian.com/apps/1213177/pull-request-notifier-for-bitbucket

Page 16: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

16

Configure Jenkins job to check PR’s in Bitbucket

Page 17: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

17

Configure Jenkins job to check PR’s in Bitbucket

Page 18: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

18

Configure Jenkins job to check PR’s in Bitbucket

Page 19: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

19

Configure Jenkins job to check PR’s in Bitbucket

Page 20: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

20

Configure Jenkins job to check PR’s in Bitbucket

Page 21: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

21

Configure Jenkins job to check PR’s in BitbucketCreate PR

Page 22: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

22

Configure Jenkins job to check PR’s in BitbucketCheck Jenkins

Page 23: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

23

Configure Jenkins job to check PR’s in Bitbucket

Check PR page

Page 24: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

Build Pipeline

While standard Jenkins “freestyle” jobs support simple continuous integration by allowing you to define sequential tasks in an application lifecycle, they do not create a persistent record of execution, enable one script to address all the steps in a complex workflow, or confer the other advantages of pipelines.

In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline functionality helps Jenkins to support continuous delivery (CD). The Pipeline plugin was built with requirements for a flexible, extensible, and script-based CD workflow capability in mind.

24

Page 25: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

Pipeline Benefits

25

Accordingly, pipeline functionality is:• Durable: Pipelines can survive both planned and unplanned restarts of

your Jenkins master;• Pausable: Pipelines can optionally stop and wait for human input or

approval before completing the jobs for which they were built;• Versatile: Pipelines support complex real-world CD requirements,

including the ability to fork or join, loop, and work in parallel with each other;

• Efficient: Pipelines can restart from any of several saved checkpoints;• Extensible: The Pipeline plugin supports custom extensions to its DSL

(domain scripting language) and multiple options for integration with other plugins.

Page 26: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

26

Page 27: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

Pipeline Benefits

27

The main feature of the Pipeline is that it’s code.

It’s written in specific file – Jenkinsfile, which is placed in project root and contains scripts that use a Pipeline DSL (domain-specific language) based on the Groovy programming language.The are 2 styles of writing the Jenkins file -Declarative &Imperativehttps://gist.github.com/abtris/e3e403d9b8cea31c66ccb67ae4c7f3f5https://habr.com/post/324688/

Our Jenkinsfile: https://gist.github.com/NikitaMitroshin/26f45425e2a134d49a16a20499c6cbe3

Page 28: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

28

Configure Build Pipeline

Jenkins – New Item – Pipeline

Page 29: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

29

Configure Build Pipeline

Pipeline configuration

Page 30: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

30

Page 31: Continuous Integration, Continuous Delivery & Continuous · 2018-10-10 · In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle. Pipeline

31

That’s it!

Thank you