fix(ci): delete completed Jobs before Flux reconciles (GRO-481) #232
@@ -82,4 +82,26 @@ jobs:
|
|||||||
--base main \
|
--base main \
|
||||||
--head "release/promote-prod-${TAG}" \
|
--head "release/promote-prod-${TAG}" \
|
||||||
--title "release: promote ${TAG} to production" \
|
--title "release: promote ${TAG} to production" \
|
||||||
--body "Promote image tag ${TAG} to production after UAT sign-off. cc @cpfarhood"
|
--body "Promote image tag ${TAG} to production after UAT sign-off. cc @cpfarhood"
|
||||||
|
|
||||||
|
- name: Delete existing completed Jobs before Flux reconciles
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag }}
|
||||||
|
run: |
|
||||||
|
SHORT_SHA="${TAG##*-}"
|
||||||
|
echo "Deleting completed Jobs with name suffix: $SHORT_SHA"
|
||||||
|
kubectl delete job "migrate-schema-${SHORT_SHA}" -n groombook --ignore-not-found
|
||||||
|
kubectl delete job "seed-test-data-${SHORT_SHA}" -n groombook --ignore-not-found
|
||||||
|
echo "Jobs deleted, Flux will reconcile with fresh objects"
|
||||||
|
|
||||||
|
- name: Notify on failure
|
||||||
|
if: failure()
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
body: '## Production Promotion Failed\n\nThe `promote-prod` workflow failed. Check the workflow run logs for details.'
|
||||||
|
});
|
||||||
|
|||||||
@@ -95,6 +95,16 @@ jobs:
|
|||||||
--body "[GRO-429](/GRO/issues/GRO-429) — UAT promotion triggered by CTO")
|
--body "[GRO-429](/GRO/issues/GRO-429) — UAT promotion triggered by CTO")
|
||||||
gh pr merge "$PR_URL" --merge
|
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
|
- name: Notify on failure
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
|
|||||||
Reference in New Issue
Block a user