continuous intergration and jenkins - linuxdays · ci, cd, devops and friends devops • dev...

18
Continuous Intergration and Jenkins Václav Šístek QA Engineer for Maintenance / Certified Jenkins Engineer SUSE / [email protected]

Upload: others

Post on 24-May-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

Continuous Intergration and Jenkins

Václav Šístek

QA Engineer for Maintenance / Certified Jenkins Engineer

SUSE / [email protected]

Page 2: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

2

Agenda

• CI, CD, DevOps and friends• Jenkins – the way to automatization• Pipeline and Blue Ocean – new trends• Demo: Pipeline, Jenkinsfile, GitHub integration

Page 3: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

3

CI, CD, DevOps and friends

Page 4: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

4

CI, CD, DevOps and friends

Benefits of Continuous Integration• Frequent integrations (daily?) prevent complex code conflicts• Testing of every integrations prevents unexpected interference of changes• Deterministic builds ensure consistent, comparable results• Next step: Continuous Delivery

– Once we have it integrated, let’s deploy it as well!

– CD ensures that end user has fixes and new features delivered fast

– CD is not for every environment though (box SW products vs. web apps)

Page 5: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

5

CI, CD, DevOps and friends

DevOps• Dev benefits from frequent integrations and deployments (less conflicts)• Ops benefits from fast resolution of bugs and issues• QA (not in the acronym!) benefits from testing of small batches of changes• Collapse of the traditional barrier between Dev, Ops and QA - DevOps!

=> Need for automation

Page 6: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

6

Jenkins – the way to automation

Page 7: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

7

Jenkins – the way to automation

What is Jenkins?

Open source automation server (MIT license)

Typical usage:

• Thousands of plugins, e.g. various SCM: Git, Mercurial, Subversion…• Platform independent: Linux, UNIX, Windows (everything that runs Java JRE)• Excellent native support of Java technologies (Maven, Junit), Docker, Git/GitHub,

live community for Android, Python, Ruby, C/C++...• Everything is possible, where there is no plugin, you can always use a shell script

Checkout Pre-Buildsteps

Build Post-buildsteps

QA Test Deploy

Page 8: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

8

Jenkins – the way to automation

Jenkins architecture

Master

Agent 1(linux)

Agent(windows)

Agent(solaris)

Build #1 Build #2

Agent 2(linux)

Build #1

Page 9: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

9

Jenkins – the way to automation

Project History• Author: Kohsuke Kawaguchi• 2005: Sun Microsystems, Hudson• 2010: Koshuke leaves Sun, InfraDNA is founded, later merged with CloudBees• 2011: Sun → Oracle, project forked as Jenkins, mainline development continues

here, with majority of the original Hudson community• 2015: Reached 100 000 installations (known ones)• Role of CloudBees Inc:

– Sponsoring of the project

– Training and certification of users and admins

– JenkinsWorld conference (formerly Jenkins User Conference)

– Closed-source product CloudBees Jenkins Enterprise with commercial suppoer and premium features

Page 10: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

10

Pipeline and Blue Ocean– new trends

Page 11: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

11

Pipeline and Blue Ocean – new trends

Pipeline• Configuration in code instead of traditional BUI-created jobs• Version-controlled groovy scripts instead of XML config files• All benefits of code – conditions, loops, functions...

Blue Ocean• New, modern, well-organized BUI• New features primarily here• Separate plugin as of now, plans to switch to it as default interface in the future

Page 12: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

12

Demo

Page 13: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

13

BUI...

Page 14: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

14

Jenkins Job Builder

# jenkins-jobs delete-all

# jenkins-jobs update jjb-test

# cat jjb-test/hello.yaml - job: name: hello-world project-type: freestyle defaults: global description: 'JJB test, do not edit this job through the web!' disabled: false display-name: 'Hello World' builders: - shell: | echo Hello

Page 15: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

15

Blue Ocean

Page 16: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

16

Jenkinsfile in GitHub repositoryAutodiscovery

Page 17: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits

17

Q&A

Page 18: Continuous Intergration and Jenkins - LinuxDays · CI, CD, DevOps and friends DevOps • Dev benefits from frequent integrations and deployments (less conflicts) • Ops benefits