DEV Community

Cover image for CI/CD pipeline
Dantis Mai
Dantis Mai

Posted on • Updated on

CI/CD pipeline

What is CI?

CI is Continuous Integration. It is a way-of-work that required teammates to integrate their work regularly. For each integration, the host server will do a series of steps to detect potential issues, automate repetitive manual processes, like test, build....

What is CD?

CD is Continuous Delivery. This process will automatically deploy every change in team code to the testing or staging environment. Besides, It also allows developers to set up other steps like system testing, performance testing... before actually deploy it to the production environment.

In addition, CD can stand for Continuous Deployment (they are all CD in short form =) ). Continuous Delivery is a technique to auto-deploy code change to the staging environment, but manually deploy to the production, and Continuous Deployment is a technique to auto-deploy to production.

Basically, the staging and production environments have the same configuration. However, the production is a serious case, we don't want to make any mistakes on it. So, we usually choose manual deployment for the production.

CI/CD process

Different processes are depending on companies. Below one is applied in most of my projects.

cicd-process

  • Step 1 [Hand]: Init repository with, usually, master, staging, and develop branch.
  • Step 2 [Hand]: Developer will do their jobs in a new branch, then create Pull Request (PR) to start Peers Review process. The new feature will be pushed to the develop branch when the PR is accepted.
  • Step 3 [Pipeline]: After pushing code to the develop branch, CI/CD pipeline is triggered to process testing. If it is passed, The feature will be deployed to the develop environment.
  • Step 4 [Hand]: Tester/QE will perform testing before confirming that the new feature is good to go.
  • Step 5 [Hand]: Developer create PR to merge code from the develop branch to the staging branch.
  • Step 6 [Pipeline]: CI/CD pipeline is triggered to process another test suite. If it is passed, the new feature will be deployed to the staging environment.
  • Step 7 [Hand]: Tester/QE will perform testing on the staging environment.
  • Step 8 [Hand]: Developer create PR to merge code from the staging branch to the master branch.
  • Step 9 [Pipeline]: CI/CD pipeline finishes its job, and the new feature will be deployed on production.
  • Step 10 [Hand]: Tester/QE need to deal with the production environment. If it is not ok, developer will roll back the previous version.
  • Step 11 [Hand]: Pray!!!🙏🤞

Pipeline tools

With the movement of DevOps methodologies and Agile culture, a lot of good CI/CD tools are developed. Depending on your favor, you can find one here. In this series, I will use CircleCI.

this is the first artical of CI/CD with CircleCI on Heroku series. Honetly, I had a lot of fun when trying to build a CI/CD pipeline for my side project, and I hope you will too.
I am really happy to receive your feedback on this article. Thanks for your precious time reading this.

Discussion (0)