“If Ops goes to lunch with Ops and Dev goes to lunch with Dev, a low level of efficiency is a certainty”-anonymous.
Like this quote, if both Dev (development) and Ops (operation) goes in different directions, it creates mayhem. So DevOps is a goal to achieve; it’s a never-end process to accelerate continuous improvement. DevOps integrate software development and operations on one platform to deliver state-of-the-art application on time.
CI and CD i.e. Continuous Integration and Continuous Deployment are the cornerstones of modern DevOps operation. This approach believes in automating everything including test, build, and deployment to link the gap between development and operation. Before understanding the CI/CD pipeline let’s have a short glimpse of DevOps.
DevOps is a modern software development approach with a push of doing everything continuously for high-quality application delivery within a short period. The DevOps development lifecycle includes continuous (development, testing, integration, deployment, and monitoring).
Pipeline terminology concerning Continuous Integration/Continuous Delivery is a set of activities channelized to be executed in a timely & step-wise or stage-wise manner periodically in the Software Development Phase. Before getting in more insights about Pipeline, at first let us understand what is CI & CD first in the context of Software Development.
CI term is a short form of Continuous Integration. CI is a process where the code is integrated into a shared repository, reviewed for coding standards & unit tested frequently to keep a check on an error-free code.
And the CD term is a short form of Continuous Delivery. CD process is performed in conjunction with the CI process. It is an activity to deploy the code or changes in staging or production environments on a subsequent basis.
In short, the CI/CD Pipeline is a path to execute each of the CI & CD activities in a gradual or step-wise manner.
CI/CD Pipeline is one of the essential aspects of DevOps in Software Development. It systematically channelizes development & delivery activities efficiently. The basic building block of Pipeline cycle recursively evolves around:
CODE > BUILD > TEST > DEPLOY > INTEGRATE & OPERATE > MONITOR |
The following are basic components or building blocks, associated with CI/CD pipeline. Let’s understand how these components contribute towards a quick delivery of apps in no time.
Version Control is an activity to maintain versions or revisions of each piece of code committed by the development team. Such code commits are managed via various version controlling systems such as GIT, Mercurial, SVN, TFS, etc.
In this block, versions or tags are specified for the code or block of code to be delivered. Along with Version Controlling, detailed code review & coding standards (in an automated approach) is also done in the phase.
The build is the phase where code compilation (if applicable) takes place. The code compilation process relies on the programming languages.
The build phase is followed by the testing phase. In this phase, various testing activities are performed in an automated way:
In this phase, code traverses to a staging server after passing through unit tests.
Once again single round of unit testing is carried out to confirm the functionalities of the code.
In this phase, the code is deployed on the production server.
The final phase in this process is monitoring or validating if the process of deployment is smoothly transitioned or not. Also, if any of the above activity fails then email & notification mechanism is available/present for alerting the respective stakeholders & development team.
Refer to the following block diagram to understand the processing in a graphical way:
CI/CD Pipeline is an essential process for the following reasons:
Jenkins Pipeline is a package of plugins to assist in implementing & integrating constant delivery pipelines. It offers extensible tools set for modeling simple and complex delivery pipelines "as code" via the Pipeline DSL.
Pipeline (both declarative & scripted) are DSLs (Domain Specific Language). To write this DSL Groovy syntax is used. Using Groovy-based commands, you can write the process flow of your pipeline process.
Step 1:
Step 2:
For this illustration, we shall add our pipeline script in the text area. Once we are done with adding, click on the Save button. This will save the job.
Step 3:
Now, to test this job, click on the “Build Now” link. This will trigger the job execution & would execute each stage specified in the pipeline script. Once the job execution is done, you can check the latest build executed in build history & click “Console Output”.
In the console output, we can note the execution of each stage along with their output.
The above illustration is a mere demonstration about usage of Pipeline concept. However, the script can be more effectively written to handle much more complex activities.
Well, this is what CI/CD Pipeline is comprised of. The above description is an abstractive explanation of the pipelines concept. For detailed input please refer to the “jenkin.io” site. We hope this piece of information serves to be helpful for understanding CI/CD pipeline specially and DevOps culture in general.