Jenkins
Prerequisites
What is CICD
In this lesson, we explore the fundamentals of CI/CD—Continuous Integration and Continuous Deployment/Delivery. These practices have become essential in modern software development, ensuring efficient code packaging, testing, and deployment across various environments, including serverless functions (AWS Lambda, Azure Functions), virtual machines, Docker containers, or on-premises systems.
Continuous Integration (CI)
Continuous Integration (CI) is the process that takes code from a version control system, compiles it, packages it, and prepares it for deployment. Think of CI as assembling a gift:
- Code components, like parts of a gift, are received from the version control repository.
- These components are assembled using various tools, similar to using a screwdriver for putting parts together.
- Once assembled, the code is wrapped up into a deployable package.
During CI, automated tests (unit tests, integration tests, and security checks) validate that the code meets quality and dependency standards before moving to the next stage.
After the packaging phase, the code moves into the CD pipeline. In CI, testing ensures that each build is robust and ready for further processing.
Continuous Delivery and Continuous Deployment (CD)
Once the code is packaged and tested in the CI stage, the next phase is deployment. This stage, known as Continuous Delivery (or Continuous Deployment), involves delivering the packaged code to a target environment, which could be serverless, containerized, a virtual machine, or on-premises hardware.
Imagine the packaged code as a wrapped gift that needs to be delivered to its recipient. This delivery represents the CD phase.
There are two primary approaches within the CD process:
Continuous Delivery
With Continuous Delivery, the deployment package is complete and fully tested, but releasing it to production requires manual approval. For instance, after the CI process concludes, an operator might log into Jenkins or another CI/CD tool and click a button to deploy the code. This method combines automation (packaging and testing) with a human decision step before production rollout.
Continuous Deployment
Continuous Deployment takes automation one step further by removing the manual approval. When code is pushed to a repository like GitHub, every successful commit that passes all automated tests is immediately deployed to the target environment. This approach minimizes delays and reduces the risk of manual errors.
A critical aspect of Continuous Deployment is ensuring secure authentication with deployment targets (such as AWS or Azure) and running post-deployment tests to verify that the application operates correctly.
Note
Both Continuous Delivery and Continuous Deployment streamline the software release process, but the choice between them depends on your organization’s requirements for automation and manual oversight.
This lesson provided an overview of the CI/CD process, detailing the role of Continuous Integration and the differences between Continuous Delivery and Continuous Deployment. In upcoming lessons, we will dive deeper into these concepts and explore advanced implementation strategies.
Thank you for reading, and see you in the next lesson.
Watch Video
Watch video content