Capstone: Full Delivery PipelineΒΆ
You have built a complete delivery pipeline, piece by piece. This capstone takes a real change all the way from a commit to production, through every stage you built, with no step-by-step hand-holding. πͺ
The goalΒΆ
Ship a new feature to production the professional way: tested, built, versioned, deployed to staging, approved, and released, all driven by a single tag.
Your taskΒΆ
- Add a small feature to the app: a
/versionendpoint that returns{"version": "1.3.0"}. - Add a test for it.
- Commit and push, so the pipeline tests and builds on
main. - Cut the release: tag
v1.3.0and push the tag. - Watch the full flow: test, build, publish, deploy to staging, then wait for approval.
- Approve the production deploy, and confirm the new version is live.
- For practice, use your Rollback workflow to return to
v1.2.0, then roll forward tov1.3.0again.
You should not need to touch the workflow files. The pipeline you built already does all of this.
HintsΒΆ
- The new route goes in
app.py; the test intest_app.py. - A plain push runs test and build. The tag is what triggers deployment.
- Production waits on the Review deployments button.
Reference solution
Add to app.py:
Add to test_app.py:
def test_version_endpoint():
client = app.test_client()
response = client.get("/version")
assert response.status_code == 200
assert response.get_json() == {"version": "1.3.0"}
Push and release:
Then approve the production deploy in the Actions tab.
β Success criteriaΒΆ
You have completed the intermediate track if:
- Pushing to
mainran test and build, but did not deploy - Pushing the
v1.3.0tag deployed to staging automatically - Production waited for your approval before going live
- The
/versionendpoint is live in production - You rolled back to
v1.2.0and forward again with the rollback workflow
π What you've builtΒΆ
Your pipeline now delivers, not just integrates. On a release tag it:
- Runs the tests
- Builds and publishes a versioned image
- Deploys to staging automatically
- Waits for a human approval
- Deploys to production
And if anything goes wrong, you can roll back to a known-good version in seconds. That is a genuine, production-grade delivery pipeline.
Next up: the Advanced track, where delivery levels up to GitOps, and your pipeline deploys to a Kubernetes cluster that keeps itself in sync with Git.