Merge remote-tracking branch 'origin/main' into feature/308-web-form
This commit is contained in:
commit
ad6ef169ac
16 changed files with 642 additions and 220 deletions
|
|
@ -5,6 +5,9 @@
|
|||
# Bootstrap runs in all environments. Dev seeds (members, groups, sample data)
|
||||
# run only in dev and test.
|
||||
#
|
||||
# In production (release): seeds are run via Mv.Release.run_seeds/0 from the
|
||||
# container entrypoint. Set RUN_DEV_SEEDS=true to also run dev seeds there.
|
||||
#
|
||||
# Compiler option ignore_module_conflict is set only during seed evaluation
|
||||
# so that eval_file of bootstrap/dev does not emit "redefining module" warnings;
|
||||
# it is always restored in `after` to avoid hiding real conflicts elsewhere.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
# Bootstrap seeds: run in all environments (dev, test, prod).
|
||||
# Creates only data required for system startup: fee types, custom fields,
|
||||
# roles, admin user, system user, global settings. No members, no groups.
|
||||
#
|
||||
# Safe to run from release (no Mix): env is taken from MIX_ENV when Mix.env/0 is not available.
|
||||
|
||||
mix_env =
|
||||
try do
|
||||
Mix.env()
|
||||
rescue
|
||||
UndefinedFunctionError -> (System.get_env("MIX_ENV") || "prod") |> String.to_atom()
|
||||
end
|
||||
|
||||
alias Mv.Accounts
|
||||
alias Mv.Membership
|
||||
|
|
@ -121,7 +130,7 @@ end
|
|||
admin_email = System.get_env("ADMIN_EMAIL") || "admin@localhost"
|
||||
System.put_env("ADMIN_EMAIL", admin_email)
|
||||
|
||||
if Mix.env() in [:dev, :test] and is_nil(System.get_env("ADMIN_PASSWORD")) and
|
||||
if mix_env in [:dev, :test] and is_nil(System.get_env("ADMIN_PASSWORD")) and
|
||||
is_nil(System.get_env("ADMIN_PASSWORD_FILE")) do
|
||||
System.put_env("ADMIN_PASSWORD", "testpassword")
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue