Skip to main content

General CI/CD pipeline examples

A general Continuous Integration/Continuous Deployment (CI/CD) pipeline is an automated workflow designed to streamline software delivery, from a developer's initial code commit to the application's deployment in a production environment. 
The pipeline typically consists of several core stages:

General CI/CD Pipeline Stages

Stage  Description Key Activities Example Tools
Source/Commit The process is triggered when a developer pushes code changes to a shared repository. Code commit, version control, manage branches. GitGitHubGitLabBitbucket
Build The committed code is fetched, compiled into an executable artifact (like a container image), and its dependencies are linked. Compiling code, packaging application, running static analysis (SAST), creating container images (Docker). Maven, Gradle, Docker, Jenkins, AWS CodeBuild
Test Automated tests are run to validate the new code and ensure it doesn't break existing functionality. Unit testing, integration testing, security testing (DAST, IAST), performance testing, regression testing. JUnit, Selenium, Jest, Pytest, Katalon, SonarQube
Staging/Deploy The application artifact is deployed to a staging or pre-production environment that mirrors the production setting. Environment provisioning, configuration, user acceptance testing (UAT). Ansible, Chef, Spinnaker, Kubernetes, AWS CodeDeploy
Production If all tests pass and stakeholders approve (in CD, this is automatic), the application is automatically deployed to the live production environment for end-users. Automated deployment, canary releases, blue-green deployments. Kubernetes, Docker, Jenkins, AWS CodePipelineAzure DevOps
Monitor/Feedback Post-deployment, the application's health, performance, and user feedback are continuously tracked. Tracking performance, error reporting, collecting user feedback. Prometheus, Grafana, New Relic, PagerDuty

Real-World Examples by Platform
Specific implementations combine the general stages using different toolchains and configurations: 
  • Jenkins Pipeline: A highly flexible, open-source example often uses Jenkins to orchestrate the entire process, integrating various plugins for tasks like building a Java web app with Maven, testing with JUnit, and deploying with Docker and Kubernetes.
  • GitLab CI/CD: GitLab offers built-in CI/CD features configured via a .gitlab-ci.yml file in the repository. A typical pipeline might involve pushing Python code to a repository, automatically triggering linting and Pytest jobs, followed by an automatic deployment to a service like Heroku upon success.
  • AWS CodePipeline: An example within the Amazon ecosystem uses AWS services exclusively. A developer commits a Node.js application to AWS CodeCommit, which triggers a CodePipeline workflow that uses CodeBuild for building and CodeDeploy for deployment to various AWS environments.
  • GitHub Actions: With GitHub Actions, workflows are triggered by events like a pull request. The workflow can automatically build and test the code in a virtual environment and then deploy the merged request to production.