Skip to content

Commit

Permalink
Fix cyndi in devel, remove db_service
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Kofink <[email protected]>
  • Loading branch information
akofink committed Jun 22, 2021
1 parent 98f552d commit 676d235
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
config = ClowderCommonRuby::Config.load
db_service = 'postgres'
username = config.database.username
password = config.database.password
host = config.database.hostname
Expand All @@ -13,7 +12,7 @@
db_service = ENV.fetch("DATABASE_SERVICE_NAME","").upcase.sub("-", "_")
username = ENV.key?("POSTGRESQL_ADMIN_PASSWORD") ? "postgres" : ENV["POSTGRESQL_USER"]
password = ENV.key?("POSTGRESQL_ADMIN_PASSWORD") ? ENV["POSTGRESQL_ADMIN_PASSWORD"] : ENV["POSTGRESQL_PASSWORD"]
host = ENV.fetch("POSTGRES_SERVICE_HOST")
host = ENV.fetch("#{db_service}_SERVICE_HOST")
database = Rails.env.test? ? ENV['POSTGRESQL_TEST_DATABASE'] || ENV["POSTGRESQL_DATABASE"] : ENV["POSTGRESQL_DATABASE"]
port = ENV.key?("POSTGRESQL_PORT") ? ENV["POSTGRESQL_PORT"] : 5432
end
Expand All @@ -31,6 +30,7 @@ default: &default

test:
<<: *default
database: <%= ENV['POSTGRESQL_TEST_DATABASE'] || database %>

production:
<<: *default
Expand Down

0 comments on commit 676d235

Please sign in to comment.