Lab 8 - CI / CD Pipeline

Return to Workshop

CI/CD Defined

In modern software projects many teams utilize the concept of Continuous Integration (CI) and Continuous Delivery (CD). By setting up a tool chain that continuously builds, tests, and stages software releases, a team can ensure that their product can be reliably released at any time. OpenShift can be an enabler in the creation and management of this tool chain.

In this lab we walk through creating a simple example of a CI/CD [pipeline] utilizing Jenkins, all running on top of OpenShift! The Jenkins job will trigger OpenShift to build and deploy a test version of the application, validate that the deployment works, and then tag the test version into production.

Create a new project

Create a new project named “cicd-YOUR# ”.

Terminal access

Create the project cicd-YOUR#

$ oc new-project cicd-YOUR#

Web Console access
Switch modes to

click "Create Project".

Fill in the Name and Display Name of the project as "cicd-YOUR# " and click "Create"

Instantiate a Jenkins server in your project

Terminal access
$ oc new-app jenkins-ephemeral --as-deployment-config=true
$ oc logs -f dc/jenkins

Wait for logs to return "Success".

NOTE: this may take some time

Web Console access
In "Developer" mode, click "+Add"

Select the "From Catalog" button, Select "Template"

Filter on "Jenkins (Ephemeral)". Then select "Jenkins (Ephemeral)".


Select the Project cicd-YOUR# from "Namespace"

Scroll down to the bottom, and click

Go to "Topology", select the deployment configuration for jenkins, under details ... wait to pod scales to 1.

Create a sample application configuration

$ oc create -f

Confirm you can access Jenkins

Terminal access
Get the route to the Jenkins server:
$ oc get route | grep jenkins | awk '{ print $2 }'

Copy the above URL, and paste it in your web browser, to access Jenkins.

Web Console access
In "Developer" mode, under "Topology", click the arrow, in the upper right corner of the "jenkins" icon

Select "Login with OpenShift" from Jenkins login page

The OpenShift login page is displayed in a new browser tab.

Login with your OpenShift user name and password

Once logged in, click the [Allow selected permissions] button and you should see the Jenkins dashboard.

Start the pipeline

Terminal access

Launch the pipeline:

$ oc start-build nodejs-sample-pipeline

Web Console access

Using the OpenShift Web Console, in "Administrator" mode, choose Builds -> Build Configs, and then click on "nodejs-sample-pipeline"

From the "Actions" menu, choose "Start Build"

Monitor the pipeline's progress

When the pipeline starts, OpenShift uploads the pipeline to the Jenkins server for execution.

The Jenkins dashboard should indicate that a new build is executing.

Back in the OpenShift Web Console, watch the pipeline execute.

Confirm that the application is available

In "Developer" mode, select the "cicd-YOUR#" project, and click on "Topology"

Click on the arrow, at the upper right corner of the "nodejs-mongodb6-example" icon, to launch the web page

Service web page displayed:


In this lab you have very quickly and easily constructed a basic pipeline.

Workshop Details

Domain Red Hat Logo
Student ID

Return to Workshop