SlideShare a Scribd company logo
© 2017 CloudBees, Inc. All Rights Reserved. 1
Distributed Pipeline Architecture
with CloudBees Jenkins Enterprise
and Docker
WORKSHOP
© 2017 CloudBees, Inc. All Rights Reserved. 2
Prerequisites
● A GitHub Account - github.com
○ with a personal access token -
https://github.com/settings/tokens
● A Docker Hub Account - hub.docker.com
● General understanding of Jenkins Pipeline
© 2017 CloudBees, Inc. All Rights Reserved. 3
DevOps Toolkit 2.1
REVIEW
© 2017 CloudBees, Inc. All Rights Reserved. 4
CD enables speed
A single CD pipeline provides your
team speed with little instability...
© 2017 CloudBees, Inc. All Rights Reserved. 5
But as CD scales business risk increases
As other teams adopt CD instability
increases and speed decreases
© 2017 CloudBees, Inc. All Rights Reserved. 6
With CloudBees, continuous scaling just works
DPA enables scale with isolated,
on-demand containerized CD servers
for each of your team
...in fact you can move faster
© 2017 CloudBees, Inc. All Rights Reserved. 7
CloudBees Distributed Pipeline Architecture
CloudBees Distributed Pipeline Architecture reduces business
risk through:
• Project Isolation
• DevOps project teams get their own Jenkins Master
• Distributes workload across masters
• Cross project contamination of workspaces and data is
eliminated
• Scalable Architecture
• Scaling and elasticity achieved through use of cluster
managed containers
• Data Isolation
• Data contamination from previous executions are easily
eliminated
© 2017 CloudBees, Inc. All Rights Reserved. 8
CloudBees Jenkins Enterprise Cluster
Automated Cluster Install
• Robust CLI for managing cluster
• Automated infrastructure
provisioning for AWS and
OpenStack
Elastic/Ephemeral Jenkins Agents
• Dynamically spins up Docker
images as agents, stops and
removes on job completion
Built-in Fault Tolerance
• JENKINS_HOME is externally
managed to provide HA for
CJOC & Jenkins Masters
• Unhealthy CJOC & Jenkins
Masters are automatically
restarted on a healthy node
Straightforward, Fast, Dynamic
Provisioning of Jenkins Masters
• Easy & quick to create Masters
of any size
• Entire Jenkins Master lifecycle is
managed by CJOC
© 2017 CloudBees, Inc. All Rights Reserved. 9
CloudBees Jenkins Enterprise Installation
Standing up a new CloudBees Jenkins Enterprise Cluster is straightforward
and fast:
• Download CJE install/CLI binary to a dedicated admin workstation
• Create a CJE project:
• $ cje init-project cje-project aws
• From the CJE project directory, initialize the new cluster:
• $ cje prepare cluster-init
• Configure common settings in cluster-init.config
• Verify and Install
• $ cje verify
• $ cje apply
• In 30 minutes or so, you will have a new CJE cluster
© 2017 CloudBees, Inc. All Rights Reserved. 10
HANDS-ON TIME
CREATE A CJE USER ACCOUNT
● Open https://goo.gl/3tRlSQ
● Click on the Create an account link
● Enter information for all fields for the Sign up form
○ Username - needs to match your GitHub
username
○ Password - no restrictions, keep it simple
● Click the Sign Up button
● Success ...
© 2017 CloudBees, Inc. All Rights Reserved. 11
Fast Provisioning of Jenkins Masters
DEMO
© 2017 CloudBees, Inc. All Rights Reserved. 12
Jenkins Masters as Code
DEMO
© 2017 CloudBees, Inc. All Rights Reserved. 13
FROM cloudbees/cje-mm:2.46.3.2
#skip setup wizard and disable CLI
ENV JVM_OPTS -Djenkins.install.runSetupWizard=false -Djenkins.CLI.disabled=true -server
#jenkins master configuration (groovy scripts)
COPY ./init.groovy.d/* /usr/share/jenkins/ref/init.groovy.d/
COPY ./license-activated/*
/usr/share/jenkins/ref/license-activated-or-renewed-after-expiration.groovy.d/
COPY ./quickstart/* /usr/share/jenkins/ref/quickstart.groovy.d/
#install additional plugins
ENV JENKINS_UC http://jenkins-updates.cloudbees.com
COPY plugins.txt plugins.txt
COPY jenkins-support /usr/local/bin/jenkins-support
COPY install-plugins.sh /usr/local/bin/install-plugins.sh
RUN /usr/local/bin/install-plugins.sh $(cat plugins.txt)
1
2
3
4
5
6
© 2017 CloudBees, Inc. All Rights Reserved. 14
Configure CJOC to Use Custom Master Image
beedemo/cje-mm:2.46.3.2
DEMO
© 2017 CloudBees, Inc. All Rights Reserved. 15
HANDS-ON TIME
PROVISION A MANAGED MASTER
● Open {CJE CJOC URL}
● Select New Item from the left menu
● Enter your first initial and last name as the item
name -> kmadel
● Select Managed Master as the item type
● Click OK
● On the Managed Master configuration page, under
Provisioning, click the Advanced button and
update the Disk value to 10
● Click the Save button at the bottom
© 2017 CloudBees, Inc. All Rights Reserved. 16
HANDS-ON TIME
FORK GITHUB REPOS
● Login to github.com
● Open github.com/beedemo/go-demo
● Click on the Fork button on the top-right of the page
● Select the GitHub account/Organization your are using for
this workshop
● Repeat for:
○ github.com/beedemo/maven-project
○ github.com/beedemo/jenkins-dind-agent
© 2017 CloudBees, Inc. All Rights Reserved. 17
Explore the Config-as-Code Managed Master
DEMO
© 2017 CloudBees, Inc. All Rights Reserved. 18
Credentials Management
DEMO
© 2017 CloudBees, Inc. All Rights Reserved. 19
HANDS-ON TIME
CONFIGURE DOCKER HUB CREDENTIALS
● Open {YOUR MASTER URL} and click the Credentials link
in the left menu
● Under Stores scoped to Jenkins, click on the (global) link
● Click the Add Credentials link in the left menu
● The Kind should default to Username with password - if
not select that from the dropdown
● Enter your Docker Hub Username and Password
● Enter an easy to remember ID such as docker-hub-kmadel
● Click the OK button at the bottom
© 2017 CloudBees, Inc. All Rights Reserved. 20
Blue Ocean and Declarative Syntax for Pipeline
Blue Ocean is the new user interface that rethinks the user experience of
Jenkins with a focus on Pipeline.
Declarative syntax for Jenkins Pipelines designed to…
• Have smarter default behavior for most use cases
• Make Pipelines more structured
• Provide better error reporting and handling
© 2017 CloudBees, Inc. All Rights Reserved. 21
Explore the go-demo Jenkinsfile
DEMO
© 2017 CloudBees, Inc. All Rights Reserved. 22
HANDS-ON TIME
UPDATE THE GO-DEMO JENKINSFILE
● Login to github.com and open github.com/{user/org}/go-demo
● Switch to the build-cache-image branch
● Open the Jenkinsfile in edit mode
● Update the DOCKER_HUB_USER to match your Docker Hub
username
● Update the DOCKER_CREDENTIAL_ID to match the ID of the
Docker Hub credential you created earlier
© 2017 CloudBees, Inc. All Rights Reserved. 23
HANDS-ON TIME
UPDATE THE GO-DEMO JENKINSFILE
● Go to the bottom to the go-demo Jenkinsfile - to the post section
● Add a success condition block, and within that block add the following step
to send a Slack notification:
○ slackSend(color: "good", message: "${env.JOB_NAME} completed
successfully, details at ${env.RUN_DISPLAY_URL}")
● Now we will add a failure block with a slight modified Slack step:
○ slackSend(color: "danger", message: "${env.JOB_NAME} failed,
details at ${env.RUN_DISPLAY_URL}")
● Add whatever Commit changes description you like and then click the
Commit changes button to commit to the build-cache-image branch
© 2017 CloudBees, Inc. All Rights Reserved. 24
Palace and Docker Agent Templates
• Palace is a built-in Shared Agent Cloud for instant access to dynamically
provisioned Jenkins Agents
• It provides Dynamic, Ephemeral and Elastic Docker Image based agents
• Easy to configure Docker Agent Templates - individual items, not part of
one massive Jenkins Cloud configuration file
• Allows defining agent templates as separate items - no other Jenkins Cloud
plugin has this level of self-service capability
• The Palace service has built-in fault tolerance identical to what is provided
for CJOC and Managed Masters
• If the cluster node running the Palace service goes down, Marathon will
automatically restart it on another healthy node
© 2017 CloudBees, Inc. All Rights Reserved. 25
HANDS-ON TIME
CREATE A DOCKER AGENT TEMPLATE
● Open {YOUR MASTER URL} and click the New Item link in the left menu
● Enter dind-compose for the item name
● Next, scroll down and select Docker Agent Template as the item type and click
the OK button
● Update the CPU shares to 0.2 and the Memory (MB) to 512
● For the Definition Image enter localhost:31095/beedemo/dind-compose-agent:go-demo
● Next, under Options, click the Add button and select Launch in privileged
mode - this is required to run Docker in a Docker container
● Click Add again, select Use a custom docker shell command and enter
wrapper.sh as the Custom shell command
● Finally, click the Save button
© 2017 CloudBees, Inc. All Rights Reserved. 26
HANDS-ON TIME
CREATE A GITHUB ORG PROJECT WITH BLUE OCEAN
● Open {YOUR MASTER URL} and click on the Blue Ocean link at the top of the page
● Next, click on the New Pipeline button on the left side of the screen
● Click on the Github button
● Enter your GitHub personal access token and click Connect
● Next select your GitHub user or a GitHub Organization you are using for this
workshop
● Select Auto-discover Jenkinsfiles to scan all of the repos in your select
account/Organization
● Click on the Create Pipelines button and watch Blue Ocean discover the repos that
have branches containing a Jenkinsfile and then click on the build-cache-image
branch
© 2017 CloudBees, Inc. All Rights Reserved. 27
HANDS-ON TIME
CREATE A PULL REQUEST TO THE GO-DEMO MASTER BRANCH
● Exit to the Jenkins classic UI by clicking on the Go to classic button
● Next, click on the Organization Folder project, click the Configure link, then click the
Save button and then switch back to the Blue Ocean UI
● Now login to github.com and open github.com/{user/org}/settings/hooks
● Next go to github.com/{user/org}/go-demo and switch to the build-cache-image
branch and click the New pull request button
● GitHub will switch you to the beedemo Org, select the base fork drop-down and
select your account/org, then select the base drop-down and select master
● Next click the Create pull request button and you should see that All checks have
passed already, so go ahead and click on Merge pull request and then Confirm
merge
● Switch back over to your Managed Master and the Blue Ocean UI
© 2017 CloudBees, Inc. All Rights Reserved. 28
Pipeline Project Recognizers and Custom Marker Files
• By default, the Pipeline Organization and Multi-branch scans will only
include repositories that have at least one branch with a file named
Jenkinsfile
• CloudBees has a feature that allows you to specify arbitrary file names,
such as pom.xml, to use instead of Jenkinsfile when scanning branches
for Pipeline Organization Folder and Multi-branch projects
• This feature allows you to automatically provide standard automation for
teams that aren’t ready to start using Jenkins Pipeline and Jenkinsfiles
quite yet
© 2017 CloudBees, Inc. All Rights Reserved. 29
HANDS-ON TIME
SET UP CUSTOM MARKER FILES
● Exit to the Jenkins classic UI by clicking on the Go to classic button
● Next, click on the Organization Folder project, click the Configure link
● Scroll down to the Project Recognizers section and click the Add button
underneath the default Pipeline Jenkinsfile project recognizer and select
Custom script
● Enter pom.xml for the Marker file, then under the Pipeline section, select
Pipeline script from SCM as the Definition and Git as the SCM
● Enter https://github.com/beedemo/custom-marker-pipelines for the
Repository URL and then enter pom-Jenkinsfile as the Script Path
● Now repeat, only specifying Dockerfile as the Marker file and
Dockerfile-Jenkinsfile as the Script Path, the click the Save button
© 2017 CloudBees, Inc. All Rights Reserved. 30
Explore the beedemo/custom-marker-pipelines Repo
DEMO
© 2017 CloudBees, Inc. All Rights Reserved. 31
UNUSED SLIDES BELOW
© 2017 CloudBees, Inc. All Rights Reserved. 32
HANDS-ON TIME
CONFIGURE GITHUB CREDENTIALS
● Click the Global credentials (unrestricted) link at the top of the
page
● Click the Add Credentials link in the left menu
● The Kind should default to Username with password - if not
select that from the dropdown
● Enter your GitHub account id as the Username value
● Enter your GitHub access token as the Password value
● Enter an easy to remember ID such as github-token-kmadel
● Click the OK button at the bottom

More Related Content

What's hot

Continuous Delivery with Jenkins & Kubernetes @ Sky
Continuous Delivery with Jenkins & Kubernetes @ SkyContinuous Delivery with Jenkins & Kubernetes @ Sky
Continuous Delivery with Jenkins & Kubernetes @ Sky
Adriana Vasiu
 
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
Analyze This! CloudBees Jenkins Cluster Operations and AnalyticsAnalyze This! CloudBees Jenkins Cluster Operations and Analytics
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
CloudBees
 
Continuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and HelmContinuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and Helm
David Currie
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
Carlos Sanchez
 
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons KrangaNext-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
JavaDayUA
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
toffermann
 
DockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times Newsroom
Docker, Inc.
 
DockerCon SF 2015: Keynote Day 1
DockerCon SF 2015: Keynote Day 1DockerCon SF 2015: Keynote Day 1
DockerCon SF 2015: Keynote Day 1
Docker, Inc.
 
2016 Docker Palo Alto - CD with ECS and Jenkins
2016 Docker Palo Alto -  CD with ECS and Jenkins2016 Docker Palo Alto -  CD with ECS and Jenkins
2016 Docker Palo Alto - CD with ECS and Jenkins
Tracy Kennedy
 
Continuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and HelmContinuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and Helm
David Currie
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
Docker, Inc.
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
Camilo Ribeiro
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CD
Henry Huang
 
Cloud Native CI/CD with Jenkins X and Knative Pipelines
Cloud Native CI/CD with Jenkins X and Knative PipelinesCloud Native CI/CD with Jenkins X and Knative Pipelines
Cloud Native CI/CD with Jenkins X and Knative Pipelines
C4Media
 
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
CloudBees
 
Continuous Delivery with Jenkins
Continuous Delivery with JenkinsContinuous Delivery with Jenkins
Continuous Delivery with Jenkins
Jadson Santos
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
Anne Gentle
 
Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016
Patrick Chanezon
 

What's hot (20)

Continuous Delivery with Jenkins & Kubernetes @ Sky
Continuous Delivery with Jenkins & Kubernetes @ SkyContinuous Delivery with Jenkins & Kubernetes @ Sky
Continuous Delivery with Jenkins & Kubernetes @ Sky
 
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
Analyze This! CloudBees Jenkins Cluster Operations and AnalyticsAnalyze This! CloudBees Jenkins Cluster Operations and Analytics
Analyze This! CloudBees Jenkins Cluster Operations and Analytics
 
Continuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and HelmContinuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and Helm
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
 
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons KrangaNext-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
Next-gen DevOps engineering with Docker and Kubernetes by Antons Kranga
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
DockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times Newsroom
 
DockerCon SF 2015: Keynote Day 1
DockerCon SF 2015: Keynote Day 1DockerCon SF 2015: Keynote Day 1
DockerCon SF 2015: Keynote Day 1
 
2016 Docker Palo Alto - CD with ECS and Jenkins
2016 Docker Palo Alto -  CD with ECS and Jenkins2016 Docker Palo Alto -  CD with ECS and Jenkins
2016 Docker Palo Alto - CD with ECS and Jenkins
 
Continuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and HelmContinuous Delivery to Kubernetes with Jenkins and Helm
Continuous Delivery to Kubernetes with Jenkins and Helm
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CD
 
Cloud Native CI/CD with Jenkins X and Knative Pipelines
Cloud Native CI/CD with Jenkins X and Knative PipelinesCloud Native CI/CD with Jenkins X and Knative Pipelines
Cloud Native CI/CD with Jenkins X and Knative Pipelines
 
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
 
Continuous Delivery with Jenkins
Continuous Delivery with JenkinsContinuous Delivery with Jenkins
Continuous Delivery with Jenkins
 
Git and GitHub for Documentation
Git and GitHub for DocumentationGit and GitHub for Documentation
Git and GitHub for Documentation
 
Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016Docker Container As A Service - JAX 2016
Docker Container As A Service - JAX 2016
 

Similar to Distributed Docker Pipeline Architecture with CloudBees Jenkins Enterprise

Docker and Jenkins [as code]
Docker and Jenkins [as code]Docker and Jenkins [as code]
Docker and Jenkins [as code]
Mark Waite
 
Cicd.pdf
Cicd.pdfCicd.pdf
Cicd.pdf
ssuser37d481
 
Introduction to Jenkins X - a beginner's guide
Introduction to Jenkins X - a beginner's guideIntroduction to Jenkins X - a beginner's guide
Introduction to Jenkins X - a beginner's guide
Andrew Bayer
 
Jenkins x gitops
Jenkins x gitopsJenkins x gitops
Jenkins x gitops
Jose Luis Sánchez Rebollo
 
IBM Container Service Overview
IBM Container Service OverviewIBM Container Service Overview
IBM Container Service Overview
Kyle Brown
 
Continuous Delivery with CloudBees Core
Continuous Delivery with CloudBees CoreContinuous Delivery with CloudBees Core
Continuous Delivery with CloudBees Core
Bhavani Rao
 
Developing Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/KubernetesDeveloping Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/Kubernetes
Chakradhar Rao Jonagam
 
Dockerfile best practices
Dockerfile best practicesDockerfile best practices
Dockerfile best practices
Bhushan Lodha
 
Introduction of CCE and DevCloud
Introduction of CCE and DevCloudIntroduction of CCE and DevCloud
Introduction of CCE and DevCloud
Opsta
 
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
{code} by Dell EMC
 
Docking, loading, running domino on docker v12
Docking, loading, running domino on docker v12Docking, loading, running domino on docker v12
Docking, loading, running domino on docker v12
Daniele Vistalli
 
Rome .NET Conference 2024 - Remote Conference
Rome .NET Conference 2024  - Remote ConferenceRome .NET Conference 2024  - Remote Conference
Rome .NET Conference 2024 - Remote Conference
Hamida Rebai Trabelsi
 
Using DC/OS for Continuous Delivery - DevPulseCon 2017
Using DC/OS for Continuous Delivery - DevPulseCon 2017Using DC/OS for Continuous Delivery - DevPulseCon 2017
Using DC/OS for Continuous Delivery - DevPulseCon 2017
pleia2
 
Ansible Meetup FI - Ansible use cases with enterprise application
Ansible Meetup FI - Ansible use cases with enterprise application Ansible Meetup FI - Ansible use cases with enterprise application
Ansible Meetup FI - Ansible use cases with enterprise application
Tanja REPO 🦊
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
LeanIX GmbH
 
Introduction to Containers: From Docker to Kubernetes and everything in-between
Introduction to Containers:  From Docker to Kubernetes and everything in-betweenIntroduction to Containers:  From Docker to Kubernetes and everything in-between
Introduction to Containers: From Docker to Kubernetes and everything in-between
All Things Open
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017
Chris Tankersley
 
Ci/CD - Stop wasting time, Automate your deployments
Ci/CD  - Stop wasting time, Automate your deploymentsCi/CD  - Stop wasting time, Automate your deployments
Ci/CD - Stop wasting time, Automate your deployments
Jerry Jalava
 

Similar to Distributed Docker Pipeline Architecture with CloudBees Jenkins Enterprise (20)

Docker and Jenkins [as code]
Docker and Jenkins [as code]Docker and Jenkins [as code]
Docker and Jenkins [as code]
 
Cicd.pdf
Cicd.pdfCicd.pdf
Cicd.pdf
 
Introduction to Jenkins X - a beginner's guide
Introduction to Jenkins X - a beginner's guideIntroduction to Jenkins X - a beginner's guide
Introduction to Jenkins X - a beginner's guide
 
Jenkins x gitops
Jenkins x gitopsJenkins x gitops
Jenkins x gitops
 
IBM Container Service Overview
IBM Container Service OverviewIBM Container Service Overview
IBM Container Service Overview
 
Continuous Delivery with CloudBees Core
Continuous Delivery with CloudBees CoreContinuous Delivery with CloudBees Core
Continuous Delivery with CloudBees Core
 
Developing Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/KubernetesDeveloping Microservices Directly in AKS/Kubernetes
Developing Microservices Directly in AKS/Kubernetes
 
Dockerfile best practices
Dockerfile best practicesDockerfile best practices
Dockerfile best practices
 
Introduction of CCE and DevCloud
Introduction of CCE and DevCloudIntroduction of CCE and DevCloud
Introduction of CCE and DevCloud
 
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...There's More to Docker than the Container: The Docker Platform - Kendrick Col...
There's More to Docker than the Container: The Docker Platform - Kendrick Col...
 
Docking, loading, running domino on docker v12
Docking, loading, running domino on docker v12Docking, loading, running domino on docker v12
Docking, loading, running domino on docker v12
 
Rome .NET Conference 2024 - Remote Conference
Rome .NET Conference 2024  - Remote ConferenceRome .NET Conference 2024  - Remote Conference
Rome .NET Conference 2024 - Remote Conference
 
Using DC/OS for Continuous Delivery - DevPulseCon 2017
Using DC/OS for Continuous Delivery - DevPulseCon 2017Using DC/OS for Continuous Delivery - DevPulseCon 2017
Using DC/OS for Continuous Delivery - DevPulseCon 2017
 
Ansible Meetup FI - Ansible use cases with enterprise application
Ansible Meetup FI - Ansible use cases with enterprise application Ansible Meetup FI - Ansible use cases with enterprise application
Ansible Meetup FI - Ansible use cases with enterprise application
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
 
Introduction to Containers: From Docker to Kubernetes and everything in-between
Introduction to Containers:  From Docker to Kubernetes and everything in-betweenIntroduction to Containers:  From Docker to Kubernetes and everything in-between
Introduction to Containers: From Docker to Kubernetes and everything in-between
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017Docker for Developers - php[tek] 2017
Docker for Developers - php[tek] 2017
 
Ci/CD - Stop wasting time, Automate your deployments
Ci/CD  - Stop wasting time, Automate your deploymentsCi/CD  - Stop wasting time, Automate your deployments
Ci/CD - Stop wasting time, Automate your deployments
 

Recently uploaded

一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 

Recently uploaded (20)

一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 

Distributed Docker Pipeline Architecture with CloudBees Jenkins Enterprise

  • 1. © 2017 CloudBees, Inc. All Rights Reserved. 1 Distributed Pipeline Architecture with CloudBees Jenkins Enterprise and Docker WORKSHOP
  • 2. © 2017 CloudBees, Inc. All Rights Reserved. 2 Prerequisites ● A GitHub Account - github.com ○ with a personal access token - https://github.com/settings/tokens ● A Docker Hub Account - hub.docker.com ● General understanding of Jenkins Pipeline
  • 3. © 2017 CloudBees, Inc. All Rights Reserved. 3 DevOps Toolkit 2.1 REVIEW
  • 4. © 2017 CloudBees, Inc. All Rights Reserved. 4 CD enables speed A single CD pipeline provides your team speed with little instability...
  • 5. © 2017 CloudBees, Inc. All Rights Reserved. 5 But as CD scales business risk increases As other teams adopt CD instability increases and speed decreases
  • 6. © 2017 CloudBees, Inc. All Rights Reserved. 6 With CloudBees, continuous scaling just works DPA enables scale with isolated, on-demand containerized CD servers for each of your team ...in fact you can move faster
  • 7. © 2017 CloudBees, Inc. All Rights Reserved. 7 CloudBees Distributed Pipeline Architecture CloudBees Distributed Pipeline Architecture reduces business risk through: • Project Isolation • DevOps project teams get their own Jenkins Master • Distributes workload across masters • Cross project contamination of workspaces and data is eliminated • Scalable Architecture • Scaling and elasticity achieved through use of cluster managed containers • Data Isolation • Data contamination from previous executions are easily eliminated
  • 8. © 2017 CloudBees, Inc. All Rights Reserved. 8 CloudBees Jenkins Enterprise Cluster Automated Cluster Install • Robust CLI for managing cluster • Automated infrastructure provisioning for AWS and OpenStack Elastic/Ephemeral Jenkins Agents • Dynamically spins up Docker images as agents, stops and removes on job completion Built-in Fault Tolerance • JENKINS_HOME is externally managed to provide HA for CJOC & Jenkins Masters • Unhealthy CJOC & Jenkins Masters are automatically restarted on a healthy node Straightforward, Fast, Dynamic Provisioning of Jenkins Masters • Easy & quick to create Masters of any size • Entire Jenkins Master lifecycle is managed by CJOC
  • 9. © 2017 CloudBees, Inc. All Rights Reserved. 9 CloudBees Jenkins Enterprise Installation Standing up a new CloudBees Jenkins Enterprise Cluster is straightforward and fast: • Download CJE install/CLI binary to a dedicated admin workstation • Create a CJE project: • $ cje init-project cje-project aws • From the CJE project directory, initialize the new cluster: • $ cje prepare cluster-init • Configure common settings in cluster-init.config • Verify and Install • $ cje verify • $ cje apply • In 30 minutes or so, you will have a new CJE cluster
  • 10. © 2017 CloudBees, Inc. All Rights Reserved. 10 HANDS-ON TIME CREATE A CJE USER ACCOUNT ● Open https://goo.gl/3tRlSQ ● Click on the Create an account link ● Enter information for all fields for the Sign up form ○ Username - needs to match your GitHub username ○ Password - no restrictions, keep it simple ● Click the Sign Up button ● Success ...
  • 11. © 2017 CloudBees, Inc. All Rights Reserved. 11 Fast Provisioning of Jenkins Masters DEMO
  • 12. © 2017 CloudBees, Inc. All Rights Reserved. 12 Jenkins Masters as Code DEMO
  • 13. © 2017 CloudBees, Inc. All Rights Reserved. 13 FROM cloudbees/cje-mm:2.46.3.2 #skip setup wizard and disable CLI ENV JVM_OPTS -Djenkins.install.runSetupWizard=false -Djenkins.CLI.disabled=true -server #jenkins master configuration (groovy scripts) COPY ./init.groovy.d/* /usr/share/jenkins/ref/init.groovy.d/ COPY ./license-activated/* /usr/share/jenkins/ref/license-activated-or-renewed-after-expiration.groovy.d/ COPY ./quickstart/* /usr/share/jenkins/ref/quickstart.groovy.d/ #install additional plugins ENV JENKINS_UC http://jenkins-updates.cloudbees.com COPY plugins.txt plugins.txt COPY jenkins-support /usr/local/bin/jenkins-support COPY install-plugins.sh /usr/local/bin/install-plugins.sh RUN /usr/local/bin/install-plugins.sh $(cat plugins.txt) 1 2 3 4 5 6
  • 14. © 2017 CloudBees, Inc. All Rights Reserved. 14 Configure CJOC to Use Custom Master Image beedemo/cje-mm:2.46.3.2 DEMO
  • 15. © 2017 CloudBees, Inc. All Rights Reserved. 15 HANDS-ON TIME PROVISION A MANAGED MASTER ● Open {CJE CJOC URL} ● Select New Item from the left menu ● Enter your first initial and last name as the item name -> kmadel ● Select Managed Master as the item type ● Click OK ● On the Managed Master configuration page, under Provisioning, click the Advanced button and update the Disk value to 10 ● Click the Save button at the bottom
  • 16. © 2017 CloudBees, Inc. All Rights Reserved. 16 HANDS-ON TIME FORK GITHUB REPOS ● Login to github.com ● Open github.com/beedemo/go-demo ● Click on the Fork button on the top-right of the page ● Select the GitHub account/Organization your are using for this workshop ● Repeat for: ○ github.com/beedemo/maven-project ○ github.com/beedemo/jenkins-dind-agent
  • 17. © 2017 CloudBees, Inc. All Rights Reserved. 17 Explore the Config-as-Code Managed Master DEMO
  • 18. © 2017 CloudBees, Inc. All Rights Reserved. 18 Credentials Management DEMO
  • 19. © 2017 CloudBees, Inc. All Rights Reserved. 19 HANDS-ON TIME CONFIGURE DOCKER HUB CREDENTIALS ● Open {YOUR MASTER URL} and click the Credentials link in the left menu ● Under Stores scoped to Jenkins, click on the (global) link ● Click the Add Credentials link in the left menu ● The Kind should default to Username with password - if not select that from the dropdown ● Enter your Docker Hub Username and Password ● Enter an easy to remember ID such as docker-hub-kmadel ● Click the OK button at the bottom
  • 20. © 2017 CloudBees, Inc. All Rights Reserved. 20 Blue Ocean and Declarative Syntax for Pipeline Blue Ocean is the new user interface that rethinks the user experience of Jenkins with a focus on Pipeline. Declarative syntax for Jenkins Pipelines designed to… • Have smarter default behavior for most use cases • Make Pipelines more structured • Provide better error reporting and handling
  • 21. © 2017 CloudBees, Inc. All Rights Reserved. 21 Explore the go-demo Jenkinsfile DEMO
  • 22. © 2017 CloudBees, Inc. All Rights Reserved. 22 HANDS-ON TIME UPDATE THE GO-DEMO JENKINSFILE ● Login to github.com and open github.com/{user/org}/go-demo ● Switch to the build-cache-image branch ● Open the Jenkinsfile in edit mode ● Update the DOCKER_HUB_USER to match your Docker Hub username ● Update the DOCKER_CREDENTIAL_ID to match the ID of the Docker Hub credential you created earlier
  • 23. © 2017 CloudBees, Inc. All Rights Reserved. 23 HANDS-ON TIME UPDATE THE GO-DEMO JENKINSFILE ● Go to the bottom to the go-demo Jenkinsfile - to the post section ● Add a success condition block, and within that block add the following step to send a Slack notification: ○ slackSend(color: "good", message: "${env.JOB_NAME} completed successfully, details at ${env.RUN_DISPLAY_URL}") ● Now we will add a failure block with a slight modified Slack step: ○ slackSend(color: "danger", message: "${env.JOB_NAME} failed, details at ${env.RUN_DISPLAY_URL}") ● Add whatever Commit changes description you like and then click the Commit changes button to commit to the build-cache-image branch
  • 24. © 2017 CloudBees, Inc. All Rights Reserved. 24 Palace and Docker Agent Templates • Palace is a built-in Shared Agent Cloud for instant access to dynamically provisioned Jenkins Agents • It provides Dynamic, Ephemeral and Elastic Docker Image based agents • Easy to configure Docker Agent Templates - individual items, not part of one massive Jenkins Cloud configuration file • Allows defining agent templates as separate items - no other Jenkins Cloud plugin has this level of self-service capability • The Palace service has built-in fault tolerance identical to what is provided for CJOC and Managed Masters • If the cluster node running the Palace service goes down, Marathon will automatically restart it on another healthy node
  • 25. © 2017 CloudBees, Inc. All Rights Reserved. 25 HANDS-ON TIME CREATE A DOCKER AGENT TEMPLATE ● Open {YOUR MASTER URL} and click the New Item link in the left menu ● Enter dind-compose for the item name ● Next, scroll down and select Docker Agent Template as the item type and click the OK button ● Update the CPU shares to 0.2 and the Memory (MB) to 512 ● For the Definition Image enter localhost:31095/beedemo/dind-compose-agent:go-demo ● Next, under Options, click the Add button and select Launch in privileged mode - this is required to run Docker in a Docker container ● Click Add again, select Use a custom docker shell command and enter wrapper.sh as the Custom shell command ● Finally, click the Save button
  • 26. © 2017 CloudBees, Inc. All Rights Reserved. 26 HANDS-ON TIME CREATE A GITHUB ORG PROJECT WITH BLUE OCEAN ● Open {YOUR MASTER URL} and click on the Blue Ocean link at the top of the page ● Next, click on the New Pipeline button on the left side of the screen ● Click on the Github button ● Enter your GitHub personal access token and click Connect ● Next select your GitHub user or a GitHub Organization you are using for this workshop ● Select Auto-discover Jenkinsfiles to scan all of the repos in your select account/Organization ● Click on the Create Pipelines button and watch Blue Ocean discover the repos that have branches containing a Jenkinsfile and then click on the build-cache-image branch
  • 27. © 2017 CloudBees, Inc. All Rights Reserved. 27 HANDS-ON TIME CREATE A PULL REQUEST TO THE GO-DEMO MASTER BRANCH ● Exit to the Jenkins classic UI by clicking on the Go to classic button ● Next, click on the Organization Folder project, click the Configure link, then click the Save button and then switch back to the Blue Ocean UI ● Now login to github.com and open github.com/{user/org}/settings/hooks ● Next go to github.com/{user/org}/go-demo and switch to the build-cache-image branch and click the New pull request button ● GitHub will switch you to the beedemo Org, select the base fork drop-down and select your account/org, then select the base drop-down and select master ● Next click the Create pull request button and you should see that All checks have passed already, so go ahead and click on Merge pull request and then Confirm merge ● Switch back over to your Managed Master and the Blue Ocean UI
  • 28. © 2017 CloudBees, Inc. All Rights Reserved. 28 Pipeline Project Recognizers and Custom Marker Files • By default, the Pipeline Organization and Multi-branch scans will only include repositories that have at least one branch with a file named Jenkinsfile • CloudBees has a feature that allows you to specify arbitrary file names, such as pom.xml, to use instead of Jenkinsfile when scanning branches for Pipeline Organization Folder and Multi-branch projects • This feature allows you to automatically provide standard automation for teams that aren’t ready to start using Jenkins Pipeline and Jenkinsfiles quite yet
  • 29. © 2017 CloudBees, Inc. All Rights Reserved. 29 HANDS-ON TIME SET UP CUSTOM MARKER FILES ● Exit to the Jenkins classic UI by clicking on the Go to classic button ● Next, click on the Organization Folder project, click the Configure link ● Scroll down to the Project Recognizers section and click the Add button underneath the default Pipeline Jenkinsfile project recognizer and select Custom script ● Enter pom.xml for the Marker file, then under the Pipeline section, select Pipeline script from SCM as the Definition and Git as the SCM ● Enter https://github.com/beedemo/custom-marker-pipelines for the Repository URL and then enter pom-Jenkinsfile as the Script Path ● Now repeat, only specifying Dockerfile as the Marker file and Dockerfile-Jenkinsfile as the Script Path, the click the Save button
  • 30. © 2017 CloudBees, Inc. All Rights Reserved. 30 Explore the beedemo/custom-marker-pipelines Repo DEMO
  • 31. © 2017 CloudBees, Inc. All Rights Reserved. 31 UNUSED SLIDES BELOW
  • 32. © 2017 CloudBees, Inc. All Rights Reserved. 32 HANDS-ON TIME CONFIGURE GITHUB CREDENTIALS ● Click the Global credentials (unrestricted) link at the top of the page ● Click the Add Credentials link in the left menu ● The Kind should default to Username with password - if not select that from the dropdown ● Enter your GitHub account id as the Username value ● Enter your GitHub access token as the Password value ● Enter an easy to remember ID such as github-token-kmadel ● Click the OK button at the bottom