From 59cd93ef669bde7ccb95887c56dbb91085c2072f Mon Sep 17 00:00:00 2001 From: Robert Prehn Date: Fri, 3 Jul 2020 10:34:19 -0500 Subject: [PATCH] chore: Add database config for CI --- .gitlab-ci.yml | 6 ++++++ config/test.exs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1d247f22..80101446 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,10 @@ image: "elixir:1.10" +variables: + DATABASE_URL: "postgres" + +services: +- name: postgres:12 + tests: script: script/cibuild \ No newline at end of file diff --git a/config/test.exs b/config/test.exs index 326eb4ed..20104996 100644 --- a/config/test.exs +++ b/config/test.exs @@ -9,7 +9,7 @@ config :legendary, Legendary.Repo, username: "postgres", password: "postgres", database: "legendary_test#{System.get_env("MIX_TEST_PARTITION")}", - hostname: "localhost", + hostname: System.get_env("DATABASE_URL") || "localhost", pool: Ecto.Adapters.SQL.Sandbox # We don't run a server during test. If one is required,