Skip to content

Commit

Permalink
Start setting up connection to figgy database
Browse files Browse the repository at this point in the history
Co-authored-by: Amin Zare <[email protected]>
Co-authored-by: Trey Pendragon <[email protected]>
Co-authored-by: Eliot Jordan <[email protected]>
Co-authored-by: Shaun Ellis <[email protected]>
  • Loading branch information
5 people committed Jul 24, 2024
1 parent f0e0b55 commit 740c648
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ executors:
- image: cimg/elixir:1.16.2-erlang-26.2.1-browsers
environment:
TEST_POSTGRES_PORT: 5432
TEST_POSTGRES_FIGGY_HOST: figgy_database
- image: cimg/postgres:15.2
- image: ghcr.io/pulibrary/dpul-collections:figgy-fixtures
name: figgy_database
working_directory: ~/project

commands:
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Config

config :dpul_collections,
ecto_repos: [DpulCollections.Repo],
ecto_repos: [DpulCollections.Repo, DpulCollections.FiggyRepo],
generators: [timestamp_type: :utc_datetime]

# Configures the endpoint
Expand Down
11 changes: 11 additions & 0 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ config :dpul_collections, DpulCollections.Repo,
show_sensitive_data_on_connection_error: true,
pool_size: 10

# Configure your other database
config :dpul_collections, DpulCollections.FiggyRepo,
username: "postgres",
password: "postgres",
hostname: "localhost",
port: "5435",
database: "postgres",
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10

# For development, we disable any cache and enable
# debugging and code reloading.
#
Expand Down
11 changes: 11 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ config :dpul_collections, DpulCollections.Repo,
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: System.schedulers_online() * 2

# Configure your other database
config :dpul_collections, DpulCollections.FiggyRepo,
username: "postgres",
password: "postgres",
hostname: System.get_env("TEST_POSTGRES_FIGGY_HOST") || "localhost",
port: System.get_env("TEST_POSTGRES_PORT") || 5435,
database: "postgres",
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10

# We don't run a server during test. If one is required,
# you can enable the server option below.
config :dpul_collections, DpulCollectionsWeb.Endpoint,
Expand Down
5 changes: 5 additions & 0 deletions lib/dpul_collections/figgy_repo.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule DpulCollections.FiggyRepo do
use Ecto.Repo,
otp_app: :dpul_collections,
adapter: Ecto.Adapters.Postgres
end

0 comments on commit 740c648

Please sign in to comment.