From 10f1cedb6fb69e9ad58f006e9252f8a3e48bae26 Mon Sep 17 00:00:00 2001 From: crimson-knight Date: Wed, 14 Sep 2022 08:54:52 -0400 Subject: [PATCH] Tweaked how the PG test data is configured --- .github/workflows/ci.yml | 11 +++++++++++ .../templates/app/config/environments/test.yml.ecr | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a52575c1..71d82b97a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,17 @@ jobs: --health-retries 5 ports: - 6379:6379 + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 steps: - name: Update & install sqlite3 diff --git a/src/amber/cli/templates/app/config/environments/test.yml.ecr b/src/amber/cli/templates/app/config/environments/test.yml.ecr index acd13de38..f440f874f 100644 --- a/src/amber/cli/templates/app/config/environments/test.yml.ecr +++ b/src/amber/cli/templates/app/config/environments/test.yml.ecr @@ -19,7 +19,7 @@ redis_url: "redis://localhost:6379" when "mysql" -%> database_url: mysql://root@localhost:3306/<%= database_name %>_test <% when "pg" -%> -database_url: postgres://postgres:password@localhost:5432/<%= database_name %>_test +database_url: <%= "postgres://postgres:#{ENV["POSTGRES_PASSWORD"]? || "password"}@localhost:5432/#{database_name}_test" %> <% when "sqlite" -%> database_url: sqlite3:./db/<%= database_name %>_test.db <% else