From 0084cafc25bd0a9fcb814c6636244132201ec2a4 Mon Sep 17 00:00:00 2001 From: nanophate Date: Mon, 12 Jul 2021 10:47:44 +0900 Subject: [PATCH] Read env instead for hardcoded settings --- .github/workflows/test.yml | 3 +++ config/database.yml | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f395ad0aa..3bf8bcae8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,9 @@ jobs: runs-on: ubuntu-latest env: DATABASE_HOST: localhost + DATABASE_USER: postgres + DATABASE_PASSWORD: password + DATABASE_PORT: 5432 TZ: Asia/Tokyo SCRIVITO_EMAIL: test@example.com SCRIVITO_PASSWORD: testpassword diff --git a/config/database.yml b/config/database.yml index 7e0512e86..1320279da 100644 --- a/config/database.yml +++ b/config/database.yml @@ -20,10 +20,10 @@ default: &default # For details on connection pooling, see Rails configuration guide # http://guides.rubyonrails.org/configuring.html#database-pooling pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - username: <%= ENV.fetch('DATABASE_USER') { 'postgres' } %> - password: <%= ENV.fetch('DATABASE_PASSWORD') { 'password' } %> - host: <%= ENV.fetch('DATABASE_HOST') { 'db' } %> - port: <%= ENV.fetch('DATABASE_PORT') { '5432' } %> + username: <%= ENV.fetch('DATABASE_USER') { '' } %> + password: <%= ENV.fetch('DATABASE_PASSWORD') { '' } %> + host: <%= ENV.fetch('DATABASE_HOST') { '' } %> + port: <%= ENV.fetch('DATABASE_PORT') { '' } %> development: <<: *default