61
©2014 CloudBees, Inc. All Rights Reserved 1 ©2014 CloudBees, Inc. All Rights Reserved Continuous delivery with Jenkins and Wildfly Tracy Kennedy Solution Architect

Continuous Delivery with Jenkins and Wildfly (2014)

Embed Size (px)

DESCRIPTION

A presentation on a continuous delivery pipeline that leverages Jenkins Enterprise, Jenkins Operations Center, Nexus, HAProxy, and Wildfly. Pipeline components run in Docker containers along with SkyDock/SkyDNS for service discovery and NSEnter for command-line access to containers.

Citation preview

Page 1: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 1©2014 CloudBees, Inc. All Rights Reserved

Continuous delivery with Jenkins and Wildfly

Tracy KennedySolution Architect

Page 2: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 2

• Solution Architect @ CloudBees

Who am I?

Git|Docker Hub: lavaliereTwitter: @Tracy_Kennedy

Page 3: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 3

Who is CloudBees?

Page 4: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 4

Who is CloudBees?

Page 5: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 5

Who is CloudBees?

Jenkins OperationsCenter

Page 6: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 6

What is Continuous Delivery?

Page 7: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 7

Target pipeline

©2013 CloudBees, Inc. All Rights Reserved

Source codeOn GitHub

Test Prod

Prod

Page 8: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 8

Tools

©2013 CloudBees, Inc. All Rights Reserved

Page 9: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 9

Tools

©2013 CloudBees, Inc. All Rights Reserved

Page 10: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 10

Tools

©2013 CloudBees, Inc. All Rights Reserved

Page 11: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 11

Tools

©2013 CloudBees, Inc. All Rights Reserved

Page 12: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 12

Tools

©2013 CloudBees, Inc. All Rights Reserved

Sets Base Image Sets the image author

Command run in a shell

Network ports to listenat runtime

Adds an entry command

Page 13: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 13

Tools

©2013 CloudBees, Inc. All Rights Reserved

Page 14: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 14

Tools

©2013 CloudBees, Inc. All Rights Reserved

Page 15: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 15

Tools

©2013 CloudBees, Inc. All Rights Reserved

Page 16: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 16

How I did itHost machine

Boot2docker VM

Container: skydockImage:

crosbymichael/SkyDock

Container: skydnsImage:

crosbymichael/skydns

Docker Server

Docker Daemon

Docker Client

Page 17: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 17

How I did it

Page 18: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 18

How I did it

Page 19: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 19

How I did it

Page 20: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 20

How I did itPlugins used:• Build Pipeline(OSS)

Page 21: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 21

How I did itPlugins used:• Config File Management (OSS)

Page 22: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 22

How I did itPlugins used:• Credentials (OSS)

Page 23: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 23

How I did itPlugins used:• Copy Artifacts (OSS)

Page 24: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 24

How I did itPlugins used:• Secure Copy (JEBC)

Page 25: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 25

How I did itPlugins used:• Jenkins Git Plugin (OSS)

Page 26: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 26

How I did itPlugins used:• Folders (JEBC)

Page 27: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 27

How I did itPlugins used:• Validated Merge (JEBC)

Page 28: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 28

How I did itPlugins used:• Fast Archiving (JEBC)

Page 29: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 29

How I did itPlugins used:• High Availability (JEBC)

Page 30: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 30

Engineering

QA

Operations

Shared Roles and

Security Realm

OC-master Server

oc.cloudbees.com

oc.cloudbees.com/qa

oc.cloudbees.com/engoc.cloudbees.com/ops

Attached-master client

Attached-master clientAttached-master client

pushed to client master

pushed to client master

pushed to client master

How I did itPlugins used:• Shared slaves (JOC)

Page 31: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 31

Roadbumps

Page 32: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 32

Roadbumps

Page 33: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 33

Roadbumps

Page 34: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 34

Roadbumps

Page 35: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 35

Roadbumps

Page 36: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 36

Roadbumps

Page 37: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 37

Roadbumps

Page 38: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 38

Roadbumps

Page 39: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 39

Roadbumps

Page 40: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 40

Roadbumps

Page 41: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 41

Roadbumps

Page 42: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 42

Roadbumps

Page 43: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 43

That saying about insanity…

Page 44: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 44

Now the show begins!

Page 45: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 45

Detailed Architecture

JenkinsOperations Centerjoc-1.jenkins-operations-center.dev.beedemo.io:8080

Jenkins Enterpriseapi-team-1.jenkins-enterprise.dev.beedemo.io:8888

SlaveSlave-1.jenkins-

slave.dev.beedemo.io:22

SlaveSlave-2.jenkins-

slave.dev.beedemo.io:22

Nexusnexus.nexus.dev.beedemo.io

:8081

Wildfly-slaveWildfly-2.wildfly.dev.beedemo.io:8080Wildfly-2.wildfly.dev.beedemo.io:9990

Wildfly-masterWildfly-1.wildfly.dev.beedemo.io:8080Wildfly-1.wildfly.dev.beedemo.io:9990

HAProxyproxy.demo-joc-haproxy.dev.beedemo.io:80

Page 46: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 46

Jenkins Job pipeline

Page 47: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 47

Jenkins Job pipeline

Page 48: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 48

Jenkins Job pipeline

Page 49: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 49

The build + Arquillian tests

Page 50: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 50

Jenkins Job pipeline

Page 51: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 51

Jenkins Job pipeline

Page 52: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 52

Jenkins to Nexus and Nexus to Jenkins

Page 53: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 53

Jenkins to Nexus and Nexus to Jenkins

Page 54: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 54

But what about this use case?

Page 55: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 55

Jenkins Job pipeline

Page 56: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 56

Jenkins Job pipeline

Page 57: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 57

Jenkins to Wildfly

Wildfly Plugin

Page 58: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 58

Jenkins to Wildfly

Page 59: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 59

Future improvements

• Templatized jobs and builders• Blue/green deployments to Wildfly• Pipeline as a workflow (OSS)• Workflow visualizations, checkpoints, etc

(JEBC)• Hosted Docker containers• Docker slaves • Building the Wildfly application as a Docker

container

Page 60: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 60

Next step

• Demo repository: https://github.com/lavaliere/demo-joc

Page 61: Continuous Delivery with Jenkins and Wildfly (2014)

©2014 CloudBees, Inc. All Rights Reserved 61©2014 Cloud Bees, Inc. All Rights Reserved