Ultimate DevOps - Jenkins Enterprise & Red Hat OpenShift

Preview:

Citation preview

Ultimate DevOps: OpenShift & CloudBees Jenkins Platform

Andy Pemberton@apemberton

About Andy

AuthorofDZone RefcardonJenkinsPipelineHands-onDeliveryexperience onCloudBeesJenkinsandPipelines

LeadCloudBeesSolutionArchitectureandConsultingTeams

@apemberton

OpenShift: PaaS by Red Hat, Built on Docker and Kubernetes

projectstemplatesapplicationsservices

routespods

imagestreamsdeployment

$ oc login --token=$foobar --server=https://api.foo.openshift.com

$ oc new-project mobile-development

$ oc project mobile-development

$ oc new-app https://github.com/cloudbees/openshift-example.git

$ oc scale mobile-deposit-ui-1 --replicas=4

Examples

$ oc help

Examples

OpenShift Web Console

Jenkins

Easy to Start

java -jar jenkins.war

Easy to Start

java -jar jenkins.war

Easy to Start

java -jar jenkins.war

Jenkins Popularity

0

1,000,000

2,000,000

3,000,000

4,000,000

5,000,000

6,000,000

7,000,000

0

20,000

40,000

60,000

80,000

100,000

120,000

11/1/2008 11/1/2009 11/1/2010 11/1/2011 11/1/2012 11/1/2013 11/1/2014

Active JenkinsInstallationsWorldwide

Total JenkinsJobsWorldwide

http://www.infoq.com/research/ci-server http://stats.jenkins-ci.org/jenkins-stats

CloudBees Jenkins Enterprise

… part of CloudBees Jenkins Platform

JenkinsfortheEnterpriseCommunityInnovation

Jenkins + OpenShift: better together

+

Jenkins + OpenShift: better together

MASTER

AGENT

AGENT

AGENT

AGENT

AGENT

AGENT

Usecase#1:OpenShiftasanElasticRuntimeforJenkins

Jenkins + OpenShift: better together

MASTER

Usecase#2:OpenShiftasdeploymenttargetfromJenkins

Jenkins + OpenShift: better together

MASTER

AGENT AGENT AGENT

Jenkins Pipeline

Pipeline: a new Job Type

Pipeline: a new Job Type

� Concise� Long-running� Durable� Flexible� Extensible

22

stage 'build'node {

checkout scmtool 'mvn-3.3'sh 'mvn clean install'stash name: 'source', excludes: 'target/'

}

stage 'test'node {

unstash 'source'sh 'mvn verify'

}

Pipeline-as-Code

PIPELINE

Jenkins Pipeline + OpenShift

Live Demo.What could go wrong?

https://github.com/cloudbees/openshift-example

wrap([$class: 'OpenShiftBuildWrapper', url: 'https://api.foobar.openshift.com',credentialsId: 'development-credentials',installation: 'oc-latest']){

...

}

YourOpenShiftserverAPI(Origin,Enterprise,etc.)

wrap([$class: 'OpenShiftBuildWrapper', url: 'https://api.foobar.openshift.com',credentialsId: 'development-credentials',installation: 'oc-latest']){

...

}

CredentialsforyourOpenShift

account(probablyaserviceaccount)

wrap([$class: 'OpenShiftBuildWrapper', url: 'https://api.foobar.openshift.com',credentialsId: 'development-credentials',installation: 'oc-latest']){

...

}

CLIversionforyourOpenShift

Server,definedbyaJenkinsTool

wrap([$class: 'OpenShiftBuildWrapper', ... ]){oc('project mobile-development -q')def bc = oc('get bc -o json')if(!bc.items) {

oc("new-app --name=mobile-deposit-ui --code='.’--image-stream=jboss-webserver30-tomcat8-openshift")

wait('app=mobile-deposit-ui', 5, 'MINUTES')oc('expose service mobile-deposit-ui')

} else {oc("start-build mobile-deposit-ui --from-dir=. --wait")

}}

Additional Resources

Additional Resources

https://blog.openshift.com/openshift-cloudbees-jenkins-enterprise-devopshttps://www.cloudbees.com/partners/platform/red-hat

@apemberton

www.cloudbees.com/get-started

CloudBees Jenkins Platform Editions

PlatinumSupport GoldSupport

EnterpriseEdition

Cloud/Container Support

PrivateSaaSEdition

ü Self-Serviceü Docker-basedü Elastic&Resilientü PrivateCloudü Analyticsü SharedResources

Recommended