CI/CD with OpenShift

Releasing software frequently to users is usually a time-consuming and painful process. Continuous Integration and Continuous Delivery (CI/CD) can help organizations to become more agile by automating and streamlining the steps involved in going from an idea, change in the market or business requirement to the delivered product to the customer.

Jenkins has been a center-piece for Continuous Integration and with the introduction of Pipeline Jenkins plugin, it has become a popular tool for building Continuous Delivery pipelines that not only builds and tests the code changes but also pushes the change through various steps required to make sure the change is ready for release in upper environments like UAT and Stage.

CI/CD is one of the popular use-cases for OpenShift Container Platform. OpenShift provides a certified Jenkins container for building Continuous Delivery pipelines and also scales the pipeline execution through on-demand provisioning of Jenkins slaves in containers. This allows Jenkins to run many jobs in parallel and removes the wait time for running builds in large projects. OpenShift provides an end-to-end solution for building complete deployment pipelines and enables the necessarily automation required for managing code and configuration changes through the pipeline out-of-the-box.
This example demonstrates how to setup a complete containerized CI/CD infrastructure on OpenShift and also how it integrates into the developer workflow. We will also explore a day in the life of a developer by adding a new REST endpoint to the application using the Eclipse-based JBoss Developer Studio and see how that propagates through the pipeline, being built, tested, deployed and promoted to upper environments.

In this example, we use the following tools to set up a CI/CD infrastructure on OpenShift:

  • Jenkins: CI/CD engine
  • Gogs: GIT server
  • Nexus Repository: build artefact repository for managing JAR, WAR and EAR files
  • SonarQube: static code analysis to detect bugs and anti-patterns

Although all above tools run in containers on OpenShift in this example, they can very well be running elsewhere on other type of infrastructure or be replaced by other popular tools like GitHub, BitBucket, GitLab, Bamboo, CircleCI, etc.

The following diagram shows the steps included in the example pipeline:


When a code or configuration commit triggers a pipeline execution:

  • Code is cloned from Gogs git server, built, tested and analyzed for bugs and anti-patterns
  • The WAR artifact build in the previous step is archived in Nexus Repository
  • OpenShift takes the WAR artefact from Nexus Repository and builds a Docker image by layering the WAR file on top of JBoss EAP 6
  • The Docker image is deployed in a fresh new container in DEV environment
  • A set of automated tests run against the application container in DEV environment.
  • If tests successful, the Docker image is tagged with the application version and gets promoted to the STAGE environment
  • The tagged image is deployed in a fresh new container in the STAGE environment


All configuration for setting up this example is available in the following GitHub repository:

OpenShift Origin, Videos

5 Responses to “CI/CD with OpenShift”

  1. rmoriz

    Please enable full-screen for the videos. Can’t read the text in such a small window

  2. David Donn

    Nice videos. I’m trying the demo. I can’t get the build to work. Jenkins can’t seem to run a slave to do the build. Any suggestions on how to troubleshoot this issue would be appreciated.

    Jenkins output…
    Still waiting to schedule task
    Waiting for next available executor

    • Ijaz Ahmed

      Not |Sure about this in Openshift But , May be , You need to check the Jenkins Global configuration , number of executors.

    • Carol Li

      You should go to openshift master and run “oc get pods” to see what is output. When build the work, there is new pods of jenkins slave need to be installed in master, if that failed, then your the build can’t proceed. I got the same problem when I trying to implement the CI/CD in my environment, maybe I can provide some information that how I fixed the problem.

  3. Siebe Ytsma

    During installation the install gogs script fails even with increased sleeps. But using install gogs from the CLI works for now.
    Running the Jenkins task ends up like David Donn also mentioned.

    The Jenkins Slave container is not created. Does anyone have some pointers to solve this issue?

Comments are closed.