Integration means adding new code to the shared codebase
What does it mean to do that continously?
These days that means git
It is common to have a linter setup - a utility that checks codestyle, formatting etc.
This ensures that the code is formatted consistently across multiple developers
After tests are green and linters have passed, another developer gives a code review.
Reviews are focused on logic and implementation
Take the approved code and package it into an artifact, pushing it to some artifact storage
Continous Integration has three goals
Continous Delivery is making sure that code is always in a releasable state.
The CD part of the pipeline is in charge of taking the artifact and deploying to an environment
The packaged code that is the result of our CI step
Releasing the artifact into a given environment
A set of services and their configuration. Isolated from each other, so they don’t share resources
A setting that changes how the artifact operates.
In one environment, the GDPR masking setting might be turned on and another might have it turned off.
Same artifact - different behaviour depending on configuration
Read more at https://12factor.net/
Most implement Continous Deployment - a pipeline that is able to deploy a given artifact to a given environment
What deploying means is different from project to project
There are many vendors in this space
To best use CI/CD, we often combine it with a standardized git workflow.
This helps write CI/CD pipelines that match the intentions when using git
Each type of branch has a meaning
Is always in a releasable state - should only be merged into when ready to release
Contains the newest features being worked on - the basis for new features
When starting work on a new feature we create a feature branch starting from develop
.
This is the main unit of work - every bit of new code starts as a feature branch and is merged back into develop
when done, through a Pull Request.
When the feature branch is merged, it should be deleted
When we are ready to release, we create a release branch and run through the release checklist.
for example:
CI/CD is often set up to run deployment if it’s a tagged commit