Continuous Integration / Continuous Deployment (CI/CD)
CI/CD
is the combined practices of continuously merging all developer’s working copies into a shared mainline (including building, testing, validation, and Versioning), and automatically deploying the build output.
Continuous Integration (CI)
With CI
a developer creates a new Pull Request whenever he believes his code changes are ready to be merged to the main branch. This triggers the CI Pipeline
to perform various activities, among which:
- Formatting: Check that the code meets formatting standards.
- Linting: Ensure that the code meets the standards of the programming language in question.
- Building: Build the code into an executable artifact.
- Testing: Execute all the unit tests and make sure they pass.
If any of these steps fail, then the developer is notified that some code changes are required, and he is required to update the Pull Request.
If everything checks out, then optionally there is an extra step where another developer has to review the changes. After approval the CI Pipeline
will generate a new Version and upload the built artifact to an Artifact Repository.
Continuous Deployment (CD)
CD
is an approach in which software components are frequently deployed. For CD
to provide value, the entire deployment process MUST be automated. It must be able to retrieve a specific Version of a software component from the Artifact Repository, and deploy it in a specific Environment.
The CD Pipeline
should be able to deploy different Versions of a software component into different Environments.
Next to being able to deploy a software component, the CD Pipeline
must also be able to deploy configuration that is Environment specific.
It is also good practice that the CD Pipeline
is able to execute integration tests to assert that the Environment is still sound after the new software component is deployed, and is able to roll back if integration tests fail.