The acronym is Continuous Integration/Continuous Deployment(Delivery). Let's consider CD as Continuous Deployment.
It is a Site Reliability Engineering approach.
It enables the addition of new code without a human effort. This code comes from hundreds of contributors from all over the world or in other words, hundreds of repositories into a single project. It would be impossible to do any feature without CI/CD system.
Somebody in the ecosystem sees that something is not working, they submit a Pull Requests proposing the change.
Some terms to understand the Git/SVN (Subversion) before we begin.
Working Copy
Working Copy is the individual copy of the working repository branch.
Checkout (Repository to Individual Machine)
The process of extracting a new working copy from the repository is called 'Checkout'. If anything goes wrong horribly, we can have always a fallback plan this does mean you can checkout a new working copy as a fresh.
Update (Repository to Individual Machine)
The process of re-synchronising the working copy with the new changes from the repository.
Commit (Individual Machine to Repository)
Nice and safely committing the changes you've done on the working copy is called Commit. Until the commit happens, the changes will not be reflected in the repository.
Revision
Each time we commit, the commit is given with unique revision number. This is hexadecimal code.
Commit Message
We have the opportunity to add some message when we commit every time.
Fork the upstream project (Checkout)
Fork/Clone the upstream project that creates a local repository in your local GitHub. Then, separate your tasks by creating more branches, otherwise it will be more complex.
Push into Local GitHub Repository
I have everything that upstream has, now I can update it and fix bugs whatever I want to do. Once the changes are done, I can push that into my Local GitHub Repository.
Submit a Pull Request (PR)
Document the PR pretty well for the reviewers, so that can understand it easily. If the PR is not well documented, it will not be reviewed. The following things needs to be covered which will make the community grow and learn.
- Why you made this request?
- What was broken?
- How you fixed it?
There is a button that says 'Open a Pull Request'. When I submit a PR, It is my branch against an upstream branch.
Reviewers review the PR submitted
After this reviewers will look into the code, and if something fails in the automation, there is something wrong in the submitted PR code. But, if everything is green, they might look for code owners to approve their code. Though the code is written well, they also might look if this is leading the project in the right direction as the owner needs it.
Automation Testing after PR
Developer, who pushed the code to repository, now needs to ensure that all the tests are running.
There are 15 automation testcases which ensure that the PR doesn't break any existing feature. All these testcases have to be Green before merging the PR.
Automation Testing Failure
This failure leads me into logs and digging out what is happening with my code and figuring out how my change broke the cluster.
Flaky Issues
The tests can be flaky. The flake test does not do the same thing when every time we run it, and there is also no guarantee that tests will do always the same thing. We might see a test that fails once in a week. This is called flaky.
Often times, flake is a real issue it can break anyone's environment when the changes are merged.
Test Environment
The pull requests are merged finally after getting the green signal from the automation testing as well as from the reviewers. This merging is an automation process like I tell the bot that I'm happy, let's merge this.
Here, we don't want a human to push the merge button. It does all automatic process.
Merge Conflicts (Rewind)
Integration Hell
Once the pull requests are merged, the environment becomes the test environment for everyone.
After the PR had been through rough waters, it finally arrived the tranquil tide pool. If the changes are in tide pool, it meant it is merged. Tide is the ocean of the PR requests.
Advantages
- Versioning control system always used for the backup purpose.
- It facilitates when hundreds of people working together to create a single project.
- It reduces the Man power or in other words human effort.
- Job is easy for every one in the eco-system as it is automated.
- Every project with often changes and releases should use CI/CD
- Every project, which has different repositories to make the whole application work, should use this.
- Developers receive immediate notification of the broken code they wrote.
- Not having CICD is intimidating in a large project.
References:
Redhat CICD pipeline
Comments
Post a Comment