CICD-178 · Annotate staging with source commit
Encyclopedia · Deployment and rollback · All snippets
Previous · CICD-177 · Next · CICD-179
1. Where it fits
- Placement Bash run step following checkout, or equivalent lab terminal.
- Prerequisites protected staging environment and trusted immutable release artifacts.
- Platforms kubernetes, local-lab.
- Parameters
GITHUB_SHA.
2. Copy the snippet
bash
kubectl -n staging annotate deployment/web "ci.example.com/source-sha=${GITHUB_SHA:?}" --overwrite3. How it works
The annotation records a source SHA on the Deployment object. It supplements, but does not replace, records that bind the running artifact digest to the source.
4. Verify the result
Record commit after validation. Add the digest and release ID to the wider audit trail.
Validation syntax-validated (Bash parse). Status definitions.