Automated CI/CD Pipeline

Automated CI/CD Pipeline

DevSecOps

ยท

2 min read

This robust pipeline covers everything from code checkout to deployment, ensuring our applications are built, tested, and deployed seamlessly.

Hereโ€™s a quick rundown of the stages:
๐—š๐—ถ๐˜ ๐—–๐—ต๐—ฒ๐—ฐ๐—ธ๐—ผ๐˜‚๐˜ - Fetching the latest code.
๐—œ๐—ป๐˜€๐˜๐—ฎ๐—น๐—น ๐——๐—ฒ๐—ฝ๐—ฒ๐—ป๐—ฑ๐—ฒ๐—ป๐—ฐ๐—ถ๐—ฒ๐˜€ - Setting up the build environment.
๐—ฅ๐˜‚๐—ป ๐—ง๐—ฒ๐˜€๐˜ ๐—–๐—ฎ๐˜€๐—ฒ๐˜€ - Ensuring code quality.
๐—ฆ๐—ผ๐—ป๐—ฎ๐—ฟ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜€๐—ถ๐˜€ - Code quality checks.
๐—ง๐—ฟ๐—ถ๐˜ƒ๐˜† ๐—™๐—ฆ ๐—ฆ๐—ฐ๐—ฎ๐—ป - Security scanning for dependencies.
๐—•๐˜‚๐—ถ๐—น๐—ฑ ๐—”๐—ฝ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป - Compiling the application.
๐—•๐˜‚๐—ถ๐—น๐—ฑ & ๐—ง๐—ฎ๐—ด ๐——๐—ผ๐—ฐ๐—ธ๐—ฒ๐—ฟ ๐—œ๐—บ๐—ฎ๐—ด๐—ฒ - Dockerizing the application.
๐—ฆ๐—ฐ๐—ฎ๐—ป ๐——๐—ผ๐—ฐ๐—ธ๐—ฒ๐—ฟ ๐—œ๐—บ๐—ฎ๐—ด๐—ฒ ๐—จ๐˜€๐—ถ๐—ป๐—ด ๐—ง๐—ฟ๐—ถ๐˜ƒ๐˜† - Ensuring image security.
๐—ฃ๐˜‚๐˜€๐—ต ๐——๐—ผ๐—ฐ๐—ธ๐—ฒ๐—ฟ ๐—œ๐—บ๐—ฎ๐—ด๐—ฒ - Uploading to Docker registry.
๐——๐—ฒ๐—ฝ๐—น๐—ผ๐˜† ๐—”๐—ฝ๐—ฝ๐—น๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐˜๐—ผ ๐—ž๐˜‚๐—ฏ๐—ฒ๐—ฟ๐—ป๐—ฒ๐˜๐—ฒ๐˜€ using ARGO CD operator - Orchestrating deployment.

Once a user commit the code chages to github, webhook trigger the jenkins pipeline, it is breaks into various stages like

  1. Checkout -> checkout from git repo

  2. Code Build -> clean and build the code

  3. Code Scan -> Sonaqube analysis , code quality check and valnurability

  4. Test -> Check test cases

  5. File System Scan -> Trivy Scan , check full filesystem vulnurability

  6. Build Image

  7. Scan imgge using trivy for security reason

  8. Upload image in repository

  9. deploy it in k8s cluster using ArgoCD operator.

Why use ArgoCD operator :

there are several reason ,

  1. Security

  2. Github is a single source of truth i.e if any malicious user changes the deploment file manually , it will not update the state, it says the someone change want to changes the file but dont worry, it will remin same, the main thing is it will check actual state and desired state equal or not.

  3. Not required any extra configuration in pipeline.

github : https://github.com/soumen321/Devsecops-Project1.git

ย