chore: adjust db conn to use injected env var
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
This commit is contained in:
parent
067eb2ae0d
commit
dd623a0547
@ -30,7 +30,14 @@ import Config
|
||||
|
||||
config :wabanex, dns_cluster_query: System.get_env("DNS_CLUSTER_QUERY") || :ignore
|
||||
|
||||
get_multi_env = fn varnames, default ->
|
||||
varnames
|
||||
|> Enum.reduce(nil, &(System.get_env(&1) || &2))
|
||||
|> Kernel.||(default)
|
||||
end
|
||||
|
||||
config :wabanex, Wabanex.Repo,
|
||||
username: System.get_env("POSTGRES_USER") || "postgres",
|
||||
password: System.get_env("POSTGRES_PASS") || "postgres",
|
||||
hostname: System.get_env("POSTGRES_HOST") || "localhost"
|
||||
username: multi_get_env.(["DB_USER", "POSTGRES_USER"], "postgres"),
|
||||
password: multi_get_env.(["DB_PASSWORD", "POSTGRES_PASS"], "postgres"),
|
||||
hostname: multi_get_env.(["DB_HOST", "POSTGRES_HOST"], "localhost"),
|
||||
port: System.get_env("DB_PORT") || "5432"
|
||||
|
@ -2,7 +2,8 @@ import Config
|
||||
|
||||
config :wabanex, Wabanex.Repo,
|
||||
database: "wabanex_test#{System.get_env("MIX_TEST_PARTITION")}",
|
||||
pool: Ecto.Adapters.SQL.Sandbox
|
||||
pool: Ecto.Adapters.SQL.Sandbox,
|
||||
pool_size: System.schedulers_online() * 2
|
||||
|
||||
config :wabanex, WabanexWeb.Endpoint,
|
||||
http: [port: 4002],
|
||||
|
Loading…
x
Reference in New Issue
Block a user