Concept Flow - CI/CD pipeline basics
Code Commit
Build Stage
Test Stage
Deploy Stage
Production Environment
The CI/CD pipeline starts with code commit, then builds the code, runs tests, and finally deploys to production.
git add .
git commit -m "Add feature"
./mvnw clean package
./mvnw test
kubectl apply -f deployment.yaml| Step | Action | Command | Result | Next Step |
|---|---|---|---|---|
| 1 | Commit code | git commit -m "Add feature" | Code saved in repo | Build Stage |
| 2 | Build app | ./mvnw clean package | Jar file created | Test Stage |
| 3 | Run tests | ./mvnw test | All tests passed | Deploy Stage |
| 4 | Deploy app | kubectl apply -f deployment.yaml | App running in production | End |
| 5 | End | - | Pipeline complete | - |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | After Step 4 |
|---|---|---|---|---|---|
| Code State | Local changes | Committed | Built | Tested | Deployed |
| Build Artifact | None | None | Jar created | Jar created | Jar deployed |
| Test Status | Not run | Not run | Not run | Passed | Passed |
| Deployment Status | Not deployed | Not deployed | Not deployed | Not deployed | Running |
CI/CD pipeline basics: 1. Commit code to start pipeline. 2. Build compiles code into executable. 3. Test verifies code correctness. 4. Deploy moves app to production. Pipeline stops if tests fail to keep production safe.