Slide 1

Slide 1 text

// Jenkins Pipelines in Continuous Action

Slide 2

Slide 2 text

// • > 10 Jahre Softwareentwicklung • Software Craftsman @cloudogu • JUG Ostfalen • Fitness / Freeletics Oliver Milke Software Craftsman https://twitter.com/OliverMilke About me https://twitter.com/cloudogu Cloudogu GmbH // 2

Slide 3

Slide 3 text

Intro Jenkins Pipelines - Überblick und Basics Pipeline Show Case //Worum geht es heute? Cloudogu GmbH // 3

Slide 4

Slide 4 text

Cloudogu GmbH // 4

Slide 5

Slide 5 text

Cloudogu GmbH // 5

Slide 6

Slide 6 text

Cloudogu GmbH // 6 1. Effizienz 2. Qualität 3. Spaß TOP 3 gute Gründe für Automatisierung

Slide 7

Slide 7 text

Cloudogu GmbH // 7 A Knightmare on Wall Street

Slide 8

Slide 8 text

Cloudogu GmbH // 8 Facts 3,3 Mrd. Transaktion pro Tag $21 Mrd. Handelsvolumen pro Tag 17% Handelsanteil an NYSE und NASDAQ $365 Mio. in Cash 31. Juli 2012

Slide 9

Slide 9 text

Cloudogu GmbH // 9 Episches Drama Softwareentwicklung und –betrieb Dev + Ops Was kostet schlechte Kultur?

Slide 10

Slide 10 text

Cloudogu GmbH // 10 Was kostet schlechte Kultur? unendlich viele Schweißperlen

Slide 11

Slide 11 text

Cloudogu GmbH // 11 Was kostet schlechte Kultur? 45 Minuten Fehlfunktion

Slide 12

Slide 12 text

Cloudogu GmbH // 12 Was kostet schlechte Kultur? $465 Mio.

Slide 13

Slide 13 text

Cloudogu GmbH // 13 Was kostet schlechte Kultur? Bankrott https://dougseven.com/2014/04/17/knightmare-a-devops-cautionary-tale

Slide 14

Slide 14 text

// “Experience is simply the name we give our mistakes.“ Oscar Wilde Cloudogu GmbH // 14

Slide 15

Slide 15 text

Cloudogu GmbH Continuous… ✓ Integration ✓ Delivery ✓ Deployment ✓ Testing ✓ Inspection ✓ Monitoring ✓ Improvement // 16

Slide 16

Slide 16 text

Cloudogu GmbH // 17

Slide 17

Slide 17 text

Cloudogu GmbH // 18

Slide 18

Slide 18 text

Cloudogu GmbH // 19

Slide 19

Slide 19 text

Cloudogu GmbH // 20

Slide 20

Slide 20 text

Cloudogu GmbH // 21

Slide 21

Slide 21 text

Cloudogu GmbH Jenkins 2 Pipeline a.k.a. Pipeline as Code Jenkinsfile // 22 https://plugins.jenkins.io/workflow-aggregator https://jenkins.io/doc/book/pipeline/

Slide 22

Slide 22 text

Cloudogu GmbH Über den Vortrag Begleitende Artikelserie // 23

Slide 23

Slide 23 text

Cloudogu GmbH Über den Vortrag Begleitende Artikelserie // 24 https://cloudogu.com/en/blog/continuous_delivery_1_basics https://cloudogu.com/en/blog/continuous_delivery_2 https://cloudogu.com/en/blog/continuous_delivery_part_3 https://cloudogu.com/en/blog/continuous_delivery_4_en

Slide 24

Slide 24 text

Grundkonzept Cloudogu GmbH // 25 ✓

Slide 25

Slide 25 text

// Steps & Stages • Teilschritte des Build-Prozesses • scm checkout • mvn package • docker build • cubectl apply • sh 'magic' • Logische Gruppierung zu Stages • Build • Test • Deploy Cloudogu GmbH // 26

Slide 26

Slide 26 text

Cloudogu GmbH // 27 http://localhost:8080/job/myPipeline/pipeline-syntax/ http://localhost:8080/job/myPipeline/pipeline-syntax/html http://localhost:8080/job/myPipeline/pipeline-syntax/globals * https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md Plugins erweitern den Funktionsumfang*

Slide 27

Slide 27 text

Pro Tip #1 Replay Cloudogu GmbH // 28

Slide 28

Slide 28 text

Jenkins Architektur Cloudogu GmbH // 29

Slide 29

Slide 29 text

Pro Tip #2 Workspace finden Cloudogu GmbH // 30

Slide 30

Slide 30 text

lange Build Jobs Parallelisierung 1 Agent* n Agents ⚠️ 1 Workspace ⚠️ Setup Synchronisierung - Beispiel Cloudogu GmbH // 31

Slide 31

Slide 31 text

lange Build Jobs nightly ⚠️ @midnight ⚠️ currentBuild.getBuildCauses() ⚠️ Feedback Cloudogu GmbH // 32

Slide 32

Slide 32 text

Pro Tip #3 Cloudogu GmbH // 33 http://www.cronmaker.com/ CronMaker is a utility which helps you to build cron expressions.

Slide 33

Slide 33 text

Ähnliche Pipelines a.k.a Don‘t Repeat Yourself Wiederverwendung load Shared Lib ⚠️ Pipeline Repository ⚠️ Groovy Script Cloudogu GmbH // 34

Slide 34

Slide 34 text

Shared Libs • Tests! • Deklaration erforderlich • Include erforderlich Cloudogu GmbH // 35

Slide 35

Slide 35 text

Jenkins Architektur Cloudogu GmbH // 36

Slide 36

Slide 36 text

Build Agents Cloudogu GmbH // 37

Slide 37

Slide 37 text

Build Agents ⚠️ Kopplung zwischen Build und Build Agents Cloudogu GmbH // 38

Slide 38

Slide 38 text

Build Agents Cloudogu GmbH // 39

Slide 39

Slide 39 text

Docker ⚠️ Cloudogu GmbH // 40

Slide 40

Slide 40 text

Build Agents Cloudogu GmbH // 41

Slide 41

Slide 41 text

// Credentials • Secrets niemals ins Jenkinsfile - never • eingebaute Sicherheitsbehandlung https://jenkins.io/doc/book/using/using-credentials/ Cloudogu GmbH // 42

Slide 42

Slide 42 text

Continuous Delivery …nur noch ein zusätzlicher Step ? Cloudogu GmbH // 43

Slide 43

Slide 43 text

Beispielhafte Pipeline Cloudogu GmbH // 44

Slide 44

Slide 44 text

Cloudogu GmbH // 45

Slide 45

Slide 45 text

Cloudogu GmbH // 46 Cloudogu Schulungen EcoSystem Beratung

Slide 46

Slide 46 text

Dogus Cloudogu GmbH // 47 Lint Setup Build Integration Tests Provision Wait 4 Dependencies Verify Clean Checkout ~ 10 Minuten

Slide 47

Slide 47 text

cloudogu.com Cloudogu GmbH // 48 Build Checkout Deploy ~ 5 Minuten

Slide 48

Slide 48 text

k8s Schulungsfolien Cloudogu GmbH // 49 Build Checkout Deploy Nexus package Deploy Kubernetes ~ 3 Minuten

Slide 49

Slide 49 text

Interne PDF Dokumentation Cloudogu GmbH // 50 Meta Data Checkout Deploy Build ~ 1 Minute

Slide 50

Slide 50 text

demo.cloudogu.net Cloudogu GmbH // 51 Decide Color Apply Demo Content Destroy Old Instance Checkout Create New Instance Switch DNS Record ~ 22 Minuten

Slide 51

Slide 51 text

private CES Demo-Instanzen Cloudogu GmbH // 52 Apply or Destroy Demo Content Checkout Verify ~ 3 Minuten

Slide 52

Slide 52 text

// Wrap Up • Jenkins Pipelines ist Classic Jenkins as Code • Steps in Stages inhaltlich gliedern • Code Generator für Neueinsteiger • Don‘t Repeat Yourself • Testautomatisierung gehört dazu • ggf. parallelisieren • Ausführung auf Docker-Build-Agents Cloudogu GmbH // 53

Slide 53

Slide 53 text

// Wrap Up • Delivery in einer Container-Welt ist einfacher • Automatisierung ist extrem wertvoll ☺ • aus Fehlern lernen ist entscheidend Cloudogu GmbH // 54

Slide 54

Slide 54 text

Danke https://cloudogu.com | https://twitter.com/cloudogu Wir sehen uns an unserem Stand! Oliver Milke