DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. CI and CD With OpenShift

CI and CD With OpenShift

Releasing software frequently to users can be time-consuming and painful. CI/CD can help, and is one of the popular use-cases for OpenShift Container Platform.

Siamak Sadeghianfar user avatar by
Siamak Sadeghianfar
·
Feb. 24, 17 · Opinion
Like (5)
Save
Tweet
Share
11.30K Views

Join the DZone community and get the full member experience.

Join For Free

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 centerpiece 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 artifact 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 another 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:

OpenShift 1

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 artifact 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.

open shift 2

All configuration for setting up this example is available in this GitHub repository.

Continuous Integration/Deployment OpenShift Contextual design Docker (software) Pipeline (software)

Published at DZone with permission of Siamak Sadeghianfar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • DevOps Roadmap for 2022
  • How to Use MQTT in Java
  • Building Angular Library and Publishing in npmjs Registry
  • Secrets Management

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: