use own pg config

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2018-01-14 00:03:04 +01:00
parent 8fbf8563f3
commit a9fe91fc23
2 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,10 @@ services:
variables: variables:
MIX_ENV: "test" MIX_ENV: "test"
POSTGRES_DB: eventos_test
POSTGRES_USER: ci
POSTGRES_PASSWORD: test
cache: cache:
key: "$CI_JOB_NAME" key: "$CI_JOB_NAME"

View File

@ -15,8 +15,8 @@ config :logger,
# Configure your database # Configure your database
config :eventos, Eventos.Repo, config :eventos, Eventos.Repo,
adapter: Ecto.Adapters.Postgres, adapter: Ecto.Adapters.Postgres,
username: if(System.get_env("CI"), do: "postgres", else: "elixir"), username: if(System.get_env("CI"), do: System.get_env("POSTGRES_USER"), else: "elixir"),
password: if(System.get_env("CI"), do: "", else: "elixir"), password: if(System.get_env("CI"), do: System.get_env("POSTGRES_PASSWORD"), else: "elixir"),
database: "eventos_test", database: "eventos_test",
hostname: if(System.get_env("CI"), do: "postgres", else: "localhost"), hostname: if(System.get_env("CI"), do: "postgres", else: "localhost"),
pool: Ecto.Adapters.SQL.Sandbox, pool: Ecto.Adapters.SQL.Sandbox,