Process Flow - Build, test, deploy stages concept
Start Pipeline
Build Stage
Test Stage
Deploy Stage
Pipeline Complete
The pipeline runs in order: first building the code, then testing it, and finally deploying it if tests pass.
pipeline {
agent any
stages {
stage('Build') { steps { echo 'Building...' } }
stage('Test') { steps { echo 'Testing...' } }
stage('Deploy') { steps { echo 'Deploying...' } }
}
}| Step | Stage | Action | Output | Next Step |
|---|---|---|---|---|
| 1 | Build | Start Build stage | Building... | Go to Test stage |
| 2 | Test | Start Test stage | Testing... | Go to Deploy stage |
| 3 | Deploy | Start Deploy stage | Deploying... | Pipeline Complete |
| 4 | End | Pipeline finished | All stages completed successfully | Stop |
| Variable | Start | After Build | After Test | After Deploy |
|---|---|---|---|---|
| stageStatus | none | build complete | test complete | deploy complete |
Jenkins pipeline runs stages in order: Build -> Test -> Deploy. Each stage must succeed for the next to run. If a stage fails, pipeline stops to prevent errors. Stages print messages to show progress. This ensures safe, step-by-step delivery of code.