Sobes.tech
Middle

What is CI/CD? What does the pipeline consist of?

sobes.tech AI

Answer from AI

CI/CD is the practice of continuous integration (CI) and continuous deployment/delivery (CD).

  • Continuous Integration (CI) — automatic merging of code changes into a shared branch, followed by automatic build and test runs.
  • Continuous Delivery (CD) — automation of release preparation so that a new version of the application is always ready for release.
  • Continuous Deployment (CD) — automatic release of a new version to production after successful completion of all stages.

A pipeline typically consists of the following stages:

  1. Build — compiling code, assembling artifacts.
  2. Test — running unit, integration, and other tests.
  3. Code quality analysis — static analysis, style checks.
  4. Deployment — deploying to test or production environments.
  5. Monitoring and notifications — tracking status and alerting the team.

Example pipeline in Jenkinsfile:

pipeline {
    stages {
        stage('Build') {
            steps { sh 'mvn clean package' }
        }
        stage('Test') {
            steps { sh 'mvn test' }
        }
        stage('Deploy') {
            steps { sh './deploy.sh' }
        }
    }
}