Fix seeds to run in production #462
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
UX research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: local-it/mitgliederverwaltung#462
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/seeds"
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?
Description of the implemented changes
The changes were:
Fix production seeds: run bootstrap in container; add RUN_DEV_SEEDS for optional dev seeds.
What has been changed?
Mv.Release.run_seeds/0New release task that runs bootstrap seeds (fee types, custom fields, roles, system user, settings) and, when
RUN_DEV_SEEDS=true, also runs dev seeds (members, groups, sample data). Uses app priv dir so it works in releases (no Mix). Idempotent; restores compiler options in anafterblock.priv/repo/seeds_bootstrap.exsSafe to run from release:
mix_envis derived fromMix.env()or, if Mix is not available (e.g. in release), fromSystem.get_env("MIX_ENV"). Replaced the singleMix.env()usage (admin password fallback for dev/test) withmix_env.rel/overlays/bin/docker-entrypoint.shAfter
migrate, the entrypoint now runsrun_seeds()(bootstrap; dev seeds only ifRUN_DEV_SEEDS=true), thenseed_admin(), then the server. Previously only migrate andseed_admin()ran, so bootstrap seeds never ran in production.priv/repo/seeds.exsComment added that in production seeds are run via
Mv.Release.run_seeds/0and thatRUN_DEV_SEEDScontrols dev seeds there.docs/admin-bootstrap-and-oidc-role-sync.mdDocumented
run_seeds/0, theRUN_DEV_SEEDSenv var, and the updated entrypoint order (migrate → run_seeds → seed_admin → server).Definition of Done
Code Quality
Accessibility
Testing
Additional Notes
migrateandseed_admin()were executed; the full seed script (bootstrap) was never invoked, andRUN_DEV_SEEDSwas not used anywhere.RUN_DEV_SEEDS=trueonly when you want dev/demo data in that environment.just ci-dev(as requested); consider running it before merge and ticking the Definition of Done items accordingly.