feat: Add hourly data reset CronJob for Prod (demo) and UAT #239
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Create a Kubernetes CronJob that resets and reseeds all test/demo data in Prod (demo) and UAT every hour.
Changes Required
1. App code
packages/db/src/reset.ts— Modify theNODE_ENVguard to allow reset whenALLOW_RESET=trueis setapps/api/Dockerfile— Addresetbuild target (afterseed):FROM builder AS resetwithCMD ["pnpm", "db:reset"].github/workflows/ci.yml— Add "Build and push Reset image" step indockerjob forghcr.io/groombook/reset2. Infra manifests
infra/apps/groombook/base/reset-cronjob.yaml— CronJobreset-demo-data, schedule0 * * * *,concurrencyPolicy: Replace, usesghcr.io/groombook/resetimage withALLOW_RESET=trueandDATABASE_URLfromgroombook-postgres-credentialssecretinfra/apps/groombook/base/kustomization.yaml— Addreset-cronjob.yamlto resourcesgroombook-postgres-credentials-uatSEED_KNOWN_USERS_ONLY=true3. CI CD job
cdjob to addghcr.io/groombook/resetimage tag to kustomization overlay updatesAcceptance Criteria
reset.tsblocks whenNODE_ENV=productionANDALLOW_RESETis nottruereset.tsallows reset whenALLOW_RESET=trueregardless ofNODE_ENVghcr.io/groombook/resetimageSEED_KNOWN_USERS_ONLY=truecc @cpfarhood
Resolved. Hourly reset CronJob was implemented in groombook/infra — see merged PRs #146, #150, #179. CronJob is running in both prod and UAT.