CICD Basics
Why do we need CICD?
- Reduces code risk by integrating code from various sources at all phases of SDLC.
- Increases confidence among coders/developers
- Better quality of code
- Branching and shipping mechanism enables ready to ship code
- Code lineage and lifecycle management using systematic versioning
- Code quality and trend analysis
- Faster and consistent time to market
- Reduces cost
CI: Continuous Integration
The CI part of CICD can be summarized with: you want all parts of what goes into making your application go to the same place and run through the same processes with results published to an easy to access place.
The simplest example of continuous integration is something you might not have even thought of being significant: committing all your application code in a single repository! While that may seem like a no-brainer, having a single place where you “integrate” all your code is the foundation for extending other, more advanced practices.
Once you have all your code and changes going to the same place, you can run some processes on that repository every time something changes. This could include:
- Run automatic code quality scans on it and generate a report of how well your latest changes adhere to good coding practices
- Build the code and run any automated tests that you might have written to make sure your changes didn’t break any functionality
- Generate and publish a test coverage report to get an idea of how thorough your automated tests are
These simple additions (made easy with tooling that will be mentioned later) allows you, the developer, to focus on writing the code. Your central repository of code is there to receive your changes while your automated processes can build, test, and scan your code while providing reports.
JENKINS
Jenkins is an open-source automation tool written in Java with plugins built for Continuous Integration purposes. Jenkins is used to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. It also allows you to continuously deliver your software by integrating with a large number of testing and deployment technologies.
With Jenkins, organizations can accelerate the software development process through automation. Jenkins integrates development life-cycle processes of all kinds, including build, document, test, package, stage, deploy, static analysis, and much more.
Jenkins achieves Continuous Integration with the help of plugins. Plugins allow the integration of Various DevOps stages. If you want to integrate a particular tool, you need to install the plugins for that tool. For example Git, Maven 2 project, Amazon EC2, HTML publisher etc.
The image below depicts that Jenkins is integrating various DevOps stages:
Advantages of Jenkins include:
- It is an open-source tool with great community support.
- It is easy to install.
- It has 1000+ plugins to ease your work. If a plugin does not exist, you can code it and share it with the community.
- It is free of cost.
- It is built with Java and hence, it is portable to all the major platforms.