fix(ci): delete completed Jobs before Flux reconciles (GRO-481)

Both promote-to-uat and promote-prod workflows now delete any
existing completed Jobs with the same short SHA suffix before Flux
reconciles. This prevents the immutable-podTemplate error that was
blocking UAT at image tag a67e541:

  Job.batch "migrate-schema-xxx" is invalid: spec.template: field is immutable

Also added missing failure notification step to promote-prod workflow.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Flea Flicker
2026-04-05 15:44:29 +00:00
parent 9a3d8d1516
commit 006c05ac77
2 changed files with 33 additions and 1 deletions
+10
View File
@@ -95,6 +95,16 @@ jobs:
--body "[GRO-429](/GRO/issues/GRO-429) — UAT promotion triggered by CTO")
gh pr merge "$PR_URL" --merge
- name: Delete existing completed Jobs before Flux reconciles
env:
TAG: ${{ inputs.image_tag }}
run: |
SHORT_SHA="${TAG##*-}"
echo "Deleting completed Jobs with name suffix: $SHORT_SHA"
kubectl delete job "migrate-schema-${SHORT_SHA}" -n groombook-uat --ignore-not-found
kubectl delete job "seed-test-data-${SHORT_SHA}" -n groombook-uat --ignore-not-found
echo "Jobs deleted, Flux will reconcile with fresh objects"
- name: Notify on failure
if: failure()
uses: actions/github-script@v7