CI/CD - Practices

CI stands for continuous integration and CD stands for continuous deployment or continuous delivery, with some minute differences between them.
CI/CD are practices used in the software development life cycle, making it more efficient, consistent, secure, easier to manage, and configure.
In continuous integration, developers frequently commit code changes to a shared repository.
This change commit then triggers the various stages of the CI, like building the code, running tests on the code, checking code quality, and making the code deployment-ready.
In continuous deployment, this ready-to-deploy code is simultaneously deployed on the target infrastructure like EC2 servers, containers, or Kubernetes pods, making updates and new features available to customers as soon as possible while maintaining security parameters.
Continuous delivery has just a minute addition of manual approval before any deployment in the production environment, whereas continuous deployment is completely automated.
CI/CD brings collaboration between the developers, operations, and QA teams, promoting faster delivery of code to the users.
The most commonly used CI/CD tools are Jenkins, GitLab CI/CD, GitHub Actions, and CircleCI.
The CI/CD pipeline typically looks like this: there is a source code management tool like GitHub where developers commit code changes. This triggers the Continuous Integration part, which has various stages like cloning the source code files, building the code (using tools like Maven), running tests on the code, and checking the code quality (using SonarQube).
Considering that our target environment is a Kubernetes cluster, the next stage after checking the code quality is building the Docker image, checking the image for any vulnerabilities, and pushing this image to an image repository like DockerHub. From this image repository, it is updated in the deployment YAML of Kubernetes. Finally, this updated deployment YAML is deployed on the Kubernetes cluster.
The deployment can be done using tools like GitOps ArgoCD, which is a Kubernetes controller.
In conclusion, CI/CD is a practice that helps us integrate code changes frequently, run tests, catch errors earlier in the software development process, and deploy the application in less time so that end users can benefit.


