Upload
red-hat-developers
View
350
Download
0
Embed Size (px)
Citation preview
Ultimate DevOps: OpenShift & CloudBees Jenkins Platform
Andy Pemberton@apemberton
About Andy
Author of DZone Refcard on Jenkins PipelineHands-on Delivery experience on CloudBees Jenkins and Pipelines
Lead CloudBees Solution Architecture and Consulting Teams
@apemberton
OpenShift: PaaS by Red Hat, Built on Docker and Kubernetes
projectstemplates
applicationsservices
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
Jenkins Popularity
11/1/2008
02/1/2009
05/1/2009
08/1/2009
11/1/2009
02/1/2010
05/1/2010
08/1/2010
11/1/2010
02/1/2011
05/1/2011
08/1/2011
11/1/2011
02/1/2012
05/1/2012
08/1/2012
11/1/2012
02/1/2013
05/1/2013
08/1/2013
11/1/2013
02/1/2014
05/1/2014
08/1/2014
11/1/2014
02/1/2015
05/1/2015
0
20,000
40,000
60,000
80,000
100,000
120,000
0
1,000,000
2,000,000
3,000,000
4,000,000
5,000,000
6,000,000
7,000,000
Active Jenkins Installations Worldwide
Total Jenkins Jobs Worldwide
http://www.infoq.com/research/ci-server http://stats.jenkins-ci.org/jenkins-stats
CloudBees Jenkins Enterprise… part of CloudBees Jenkins Platform
Jenkins for the EnterpriseCommunity Innovation
Jenkins + OpenShift: better together
+
Jenkins + OpenShift: better together
MASTER
AGENT
AGENT
AGENT
AGENT
AGENT
AGENT
Use case #1: OpenShift as an Elastic Runtime for Jenkins
Jenkins + OpenShift: better together
MASTER
Use case #2: OpenShift as deployment target from Jenkins
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
19
stage 'build' node { checkout scm tool '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']){
...
}
Your OpenShift server API (Origin,
Enterprise, etc.)Credentials for your OpenShift
account (probably a serviceaccount)
CLI version for your OpenShift
Server, defined by a Jenkins Tool
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
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
Platinum Support Gold Support
Enterprise Edition
Cloud/Container Support
Support and features for running Jenkins @ enterprise scalePrivate SaaS Edition Self-Service Docker-based Elastic & Resilient Private Cloud Analytics Shared Resources